1 2 Previous Next 16 Replies Latest reply on Sep 7, 2018 10:25 AM by Meghan Kyle

# Tableau Calculation adding extreme decimal

All,

I have a set of data that is calculating the percent difference from Y/Y.  I have pulled the data from tableau into excel and confirmed that there is no decimal difference but tableau is coming up with these extreme decimals....any ideas? • ###### 1. Re: Tableau Calculation adding extreme decimal

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

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

Have you told Tableau to format it for "X" number of decimal places?

• ###### 4. Re: Tableau Calculation adding extreme decimal

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

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

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

You can change the value in your conditional formatting, let's say to 0.000001

Ramon

• ###### 8. Re: Re: Tableau Calculation adding extreme decimal

Can you use something like this?

[pct] = round([your calc],2)

Pedro

• ###### 9. Re: Re: Tableau Calculation adding extreme decimal

See example data, although it does not recreate the problem

• ###### 10. Re: Re: Re: Tableau Calculation adding extreme decimal

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

• ###### 11. Re: Tableau Calculation adding extreme decimal

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

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

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

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?

1 2 Previous Next