10 Replies Latest reply on Mar 10, 2017 7:22 AM by Jim Dehner

# Decimal points in Tableau

i wonder how tableau able to generate decimals in my data, when the data is only int(8,2) but data generated by tableau after using Calculated Field is becomes more than 2 decimal points.

WHEN MY DATA IN db is only 2 DP. This happened when i use the calculated field: STR(AVG([Humidity Hourly])) + "" + "%"

• ###### 1. Re: Decimal points in Tableau

Hi Stan the process is straight forward

Right click on the measure name and follow the path >> Default Properties >> Number Format and the box below will open - you can dial in the format you want

Let me know if this helped

Jim

• ###### 2. Re: Decimal points in Tableau

Hi Sir,

I have actually put the decimal to 0, but still the calculated field formula is giving me lots of decimal points.

• ###### 3. Re: Decimal points in Tableau

Hi

You have 2 pills on the detail shelf that marked text One Blue and the other green - The green pill marked Avg Humidity hourly is the  measure that you changed to 0 decimals - one of the other pills is generating the label with all the decimals - what is the Blue pill that is a string Humidity symbol - it is assigned to text and is the probable cause of the value with the large number of decimals

Jim

• ###### 4. Re: Decimal points in Tableau

I have created 2 calculated field:

1. int(AVG([Humidity Hourly]))/100

2. str([Humidity Symbols]*100)+ "" + "%"

most of the data is correct, but now the problem is 3 data is having decimal points... why?

• ###### 5. Re: Decimal points in Tableau

Ok

Stan it would be easier if you could attache the workbook - I understand if there are confidential issues

Now for the the one formula  >> str([Humidity Symbols]*100)+ "" + "%"  I would suggest putting in a Round Function like to get 2 decimal point

str(Round(([Humidity Symbols]*100),2))+ "" + "%"

Jim

2 of 2 people found this helpful
• ###### 6. Re: Decimal points in Tableau

Hi Tom

I didn't know that - well I learned something today

Jim

• ###### 7. Re: Decimal points in Tableau

Hi Jim,

Thanks for your advice, after i did it, the decimal all round down to nearest 0, how to make it back?

i have tried the default properties -- 3 decimals and data = decimals too, still the decimals do not appear, just .000

• ###### 8. Re: Decimal points in Tableau

See Tom's note above - he may be closer to the answer you are looking for

Jim

• ###### 9. Re: Decimal points in Tableau

Jim,

You learned something wrong, unlearn it!

Stan,

Your label on your datapoint is being controlled by the calculated field you're creating. It's not really clear with your latest screenshots what that field is, or how you're actually calculating it. We really need a packaged workbook as a sample to nail this down.

With that being said, given that you're using a calculated field which is outputting a string, you should probably just wrap your calc in a ROUND() formula to get the desired accuracy you want. I.e. ROUND([field]/[field]*100,2) for decimal places.

• ###### 10. Re: Decimal points in Tableau

Tom

I promise to un-learn it - not difficult at my age

Jim

1 of 1 people found this helpful