Hi,
We are experiencing some strange behaviour with a SUM aggregate on a measure that is not showing the correct total.
Of a certain product we have 19 sales on one period. They have prices of 1.36, -1.36 and 0. These effectively cancel each other out, so the sum should be simply 0.
YearMonth | INN_FEE_incl_VAT |
201403 |
1.36 |
201403 |
1.36 |
201403 |
1.36 |
201403 |
1.36 |
201403 |
1.36 |
201403 |
-1.36 |
201403 |
-1.36 |
201403 |
-1.36 |
201403 |
-1.36 |
201403 |
-1.36 |
201403 |
0 |
201403 |
0 |
201403 |
0 |
201403 |
0 |
201403 |
0 |
201403 |
0 |
201403 |
0 |
201403 |
0 |
201403 |
0 |
WITH MEMBER [Measures].[YearMonth]
as [Time].[Month].Member_value
MEMBER [Measures].[CNK]
as [Product].[CNK].Member_value
SELECTNONEMPTY
{
[Measures].[YearMonth],
[Measures].[CNK],
[Measures].[INN Fee incl VAT]
} dimensionpropertiesmember_valueONCOLUMNS,
NonEmpty({
[Time].[Time].[Month].members
} )
*
NonEmpty({
[Product].[CNK].[CNK].Members
})dimensionpropertiesmember_value, member_captionONROWS
FROM DeliveryCube10
cellproperties
VALUE, FORMAT_STRING,
FORMATTED_VALUE
However, a query with MDX returns us:
YearMonth INN_Fee_incl_VAT
201403 - 4.4408920985006262E-16
And in excel we see a cell displaying -0.00 but who has a value of 4.4408920985006262E
What makes this even more bizarre is that it is not the only product with a price of 1.36 whose sales balance out to zero. There are others with far more occurrences which do give correct results. In the same column, in the same cube, same date dimension,
but another product dimension.
The datatype in the SQL table is decimal(19,2) The datatype in SSAS is double The measure format string is #,##0.00;-#,##0.00 In the measure source format string I also tried #,##0.00;-#,##0.00 NullProcessing = ZeroOrBlank (but there aren’t any NULLS) InvalidXmlCharacters
= Remove IsAgrettable = True is set on both dimensions
I created a minimal cube to eliminate all possible errors. So I have only one partition.
The error is not in the data itself; in SQL we have a SUM that is correct.
I am testing this on a SQL Server 2014 Developer Edition, Service pack 2 We are using the dimensional model (not tabular) On windows 2012 R2
Thanks for any help,
Jan