Camille
Camille

Reputation: 233

Rounding issue in formula used in Tableau

Please could someone help. I have used this formula in my Tableau Desktop so that in the tooltip (when I hover on the bar chart) it can display figures with 0 Decimal Places.

int(IIF((ZN(round(SUM([Rental Area])),0) - LOOKUP(ZN(round(SUM([Rental Area])),0), -1)) / ABS(LOOKUP(ZN(round(SUM([Rental Area])),0), -1))
=-1,null,ZN(round(SUM(Rental Area])),0) - LOOKUP(ZN(round(SUM([Rental Area])),0), -1)))

What it is displaying is...example 349.0 or 45.0 and NOT 349 or 45

Upvotes: 0

Views: 1496

Answers (2)

S. User18
S. User18

Reputation: 712

Right-click your calculated field in the Measures pane and choose "Default Properties -> Number Format". In the Number Format window that opens, choose "Number (Custom)" and set to zero decimal places.

Upvotes: 3

Gaurav
Gaurav

Reputation: 1109

You can put your IIF statement inside INT. Hope that will help. Refer to Tableau community link.

Upvotes: 0

Related Questions