简体   繁体   中英

Calculation Error in SSAS VS 2005

I am currently using SQL Server 2005 with Visual Studio 2005. I have build a Data Warehouse that is pulling License Fees (in Euros) for Microsoft and SAP users divided by QTR.

I created a Calculation that converts the Euro costs into USD. The individual Quarters are calculating correctly but the SUM is calculation a total from the three listed Measures and the Quater total creating an inaccurate SUM.

I have verified that all of the table data is correct and I traced the error to the Calculation. I just dont know what I am missing to correct the SUM and have it sum only the fields for the QTRs and not every Listed Measure from teh Fact Table AND the Visable Totals.

Thank you for any help you can provide.

If the error is of type: 1.01 + 1.02 + 1.03 = 3.0600001, then it's expected behaviour of floating point calculations. This is due to the fact that many finite fractions can't be represented in finite number of bits in binary -- just as 1/3 can't be represented with finite number of digits in base ten.

(in google spreadsheets's eg. 507.05 - 511.44 produces -4.38999)

This can be circumvented in many languages by using variable type 'currency', which may be simulated by expressing all values internally in integer number of cents and placing the decimal point only when showing the result.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM