Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

Float data types

$
0
0
I don't really know SSAS but have been a .NET programmer and worked with SQL Server and T-SQL for years. I am working on a project where there is a database storing sales transactions and a cube that is created nightly so we can get MTD Sales, YTD Sales, Profit $, etc.I just ran into an issue where I got an error retrieving the Profit $ measure (using an MDX query inside of a SQL stored procedure using OPENQUERY) and found that the profit $ should be 0.07 but is coming back as 6.9999999999993179E-2. After talking to our DBA, he said all of the calculations in the cube are double precision floating point and I need to round all results to 2 decimal places (programs like Excel handle the rounding and I should too.)Our DBA also claims the measures can't be calculated and returned as currency. He claims that the potential for error is very small and no one has ever complained about a $ value being off.I am struggling with this answer because I have always been told never to use floating point for monetary values. I am having a hard time believing there is no way to have a measure be a currency field that is accurate. I looked for articles online but can't seem to find anything to answer my questions.Could someone please point me in the right direction? Thanks so much!

Viewing all articles
Browse latest Browse all 1341

Trending Articles