
1. Re: Tableau Calculation adding extreme decimal
Ramon Martinez Oct 15, 2013 1:23 PM (in response to Bryce Cazier)Bryce,
Could you provide more information about your specific situation. Maybe sharing a packaged workbook with some of your data in order to see if we can find the problem and propose a solution.
Best,
Ramon

2. Re: Tableau Calculation adding extreme decimal
Bryce Cazier Oct 15, 2013 1:31 PM (in response to Ramon Martinez)Unfortunately, I can not share the data, but can explain more.
I have a tab that places values according to a column and row set of variables, much like a pivot table. This tab can be single selected to change according to product. Then, on the next tab I drop the detail and end up with a summary by product. See shots below.
There is a table like this that can be generated for every product. And, I can confirm that they all show zero. However, when I drop the detail I get this...

3. Re: Tableau Calculation adding extreme decimal
Ben Neville Oct 15, 2013 1:36 PM (in response to Bryce Cazier)Have you told Tableau to format it for "X" number of decimal places?

4. Re: Tableau Calculation adding extreme decimal
Bryce Cazier Oct 15, 2013 1:38 PM (in response to Ben Neville)That would fix the visible number, but will not correct the conditional formatting. I need these values to truely to zero to be a useful auditing tool.

5. Re: Tableau Calculation adding extreme decimal
Ramon Martinez Oct 15, 2013 1:41 PM (in response to Bryce Cazier)I would start by controlling the number of decimals in the format of the measure. As you are dealing with percent difference maybe just one decimal place is enough.
The other aspect I would check is the formula you are using for the calculation of percent difference under the scenario of aggregation by product.
An hypothetical data sample would be good to check the problem
Best,
Ramon

6. Re: Tableau Calculation adding extreme decimal
Ben Neville Oct 15, 2013 1:43 PM (in response to Bryce Cazier)Sorry for not being clearer, Bryce. My supposition based on the information provided was that perhaps you had told Tableau to round to a certain number of decimal places. Everything occurred at < 5 of the last number in the decimal, thus did not round up. When you removed the dimension, the numbers were summed, and Tableau added them up to be > 0.
My question would more accurately be: Have you already told Tableau to limit the result to only a certain number of decimals? Because doing so could possibly force Tableau to display 0's when the numbers were actually slightly above 0.

7. Re: Tableau Calculation adding extreme decimal
Ramon Martinez Oct 15, 2013 1:43 PM (in response to Bryce Cazier)You can change the value in your conditional formatting, let's say to 0.000001
Ramon

8. Re: Re: Tableau Calculation adding extreme decimal
Pedro Machado Oct 15, 2013 1:51 PM (in response to Bryce Cazier)Can you use something like this?
[pct] = round([your calc],2)
Pedro

9. Re: Re: Tableau Calculation adding extreme decimal
Bryce Cazier Oct 15, 2013 1:51 PM (in response to Ramon Martinez)See example data, although it does not recreate the problem

tableauexample.twb.zip 29.8 KB

tableauexamplev2.xls 15.5 KB


10. Re: Re: Re: Tableau Calculation adding extreme decimal
Ramon Martinez Oct 15, 2013 2:24 PM (in response to Bryce Cazier)According to your data, was not possible to reproduce the problem you originally have. It seems that it is matter of precision with small differences between numerator and denominator for some type of aggregation.
Said that, I incline for the solution proposed by Pedro, forcing the calculation to round to a specific decimal number.
I change slightly the first value of source a as 61.1600000000001 to demonstrate the issue. See the work book attached.
I create a table calculation for coding the color of your calc, see the sheet2 in the workbook. Note the first value is red because is different to zero
Than I create other calculated field "clacl2" where, applying the solution proposed by Pedro, force the calculation to have only few decimal places. See Sheet3 .
Let me know if this help.
Ramon

tableauexample_decimals.twbx.zip 103.7 KB


11. Re: Tableau Calculation adding extreme decimal
Jonathan Drummey Oct 16, 2013 7:39 AM (in response to Bryce Cazier)What is the exact formula of the calculation? I'm asking because I've seen some issues with the ROUND() function where it returns 16 digits of decimals.

12. Re: Tableau Calculation adding extreme decimal
Ramon Martinez Oct 16, 2013 7:49 AM (in response to Jonathan Drummey)Jonathan,
In my workbook the formula for tableau calculation calc2 is:
ROUND((sum([value source a])/sum([value source b]))1,4)
With this formula I'm forcing the precision to only 4 decimals. Meanwhile, in the view Sheet 3 I intentionally change the format to display more decimal places just to demonstrate the difference with the calculation calc that is shown in Sheet 2
Let me know if this clarify the point. Please share the issues you have seen with the ROUND() function.
Best,
Ramon

13. Re: Tableau Calculation adding extreme decimal
Rawan Alsiekh Jan 10, 2014 6:36 AM (in response to Bryce Cazier)I am having the same issue with a measure already built in the database (relational), It is set to 2 scale digits, but yet every time I use it in Tableau I can see 16 digits (something like 0.0000000000000123), does not show in Excel. I also need to filter the data to the 0s only but I can't do it because of the decimal digits issue.
To fix it though, I created a calculated field that forces it to round to only 2 digits.
What could cause such a problem in Tableau? I hope they fixed it in 8.1 (since I am using 8 now).
Thanks
Rawan

14. Re: Tableau Calculation adding extreme decimal
Meghan Kyle Apr 9, 2018 2:05 PM (in response to Rawan Alsiekh)I am having this exact problem in 10.3.2.
My developers have set the data type of the field to money in SQL. But when I connect to the field via Tableau Desktop 10.3.2 it produces this insane number out to 16 decimal places. .....0.0000000000000213...like what is that?