1 2 3 Previous Next 60 Replies Latest reply on Jun 22, 2017 6:44 AM by suvas.chandra

# Number format

I have 70.999, 80.556, 90.123, 60.234 etc... ... What is the function to write:  70, 80, 90, 60 etc. Round will not work in this case.

• ###### 1. Re: Number format

FLOOR()

• ###### 2. Re: Number format

I don't see any function in Tableau 9.2 called Floor ().

• ###### 3. Re: Number format

Are you using extracted data or a live connection?  FLOOR should be available in 9.x and above.

• ###### 4. Re: Number format

If you have a live connection then I would assume it's not supported in your data source.

Number Functions

Alternatively, you can use this as a calc (borrowed from Jonathon Drummey) to get FLOOR

IF [Value]==INT([Value]) THEN

[Value]

ELSEIF [Value]<0 THEN

INT([Value]-1)

ELSE

INT([Value])

END

• ###### 5. Re: Number format

It did not work......

IF [Actual % of Baseline Remaining]==INT ([Actual % of Baseline Remaining])
THEN [Actual % of Baseline Remaining]

ELSEIF [Actual % of Baseline Remaining] <0
THEN INT([Actual % of Baseline Remaining]-1)

ELSE INT([Actual % of Baseline Remaining])

END

//////////////////////////////

Actual % Baseline Remaining

If [Month Type] = 'Actual' Then [Baseline Remaining %] END

////////////////////////////////

Baseline Remaining

(([Gc Tot]+[Gleg Tot])/[Gbase Tot])*100

• ###### 6. Re: Number format

Upload a packaged workbook so we can see what is actually occurring then.

• ###### 7. Re: Number format

How about simply trying INT()?  What results does it give you?

• ###### 8. Re: Number format

Calculation 1 and 2 both works. I had to change them to ATTR. Which should I use 1 or 2 ?

• ###### 9. Re: Number format

Use the simplest that is working...either FLOOR(), INT() or the IF statement.

• ###### 10. Re: Number format

Sorry, results are not 100% correct. There is still some difference.

• ###### 11. Re: Number format

Sorry, I think, I did not tell it correctly

I have the numbers like this:  64.99, 50.65, 43.86, 10.91, 8.62, 0.23

But, I want it to look like: 65, 51, 44, 11, 9, 1

0.23 should be 1, how do I write the rule ?

• ###### 12. Re: Number format

SO maybe :

ROUND(if [Value] < 1 then 1 else [Value] end,0)

I haven't tested this in Tableau though.

• ###### 13. Re: Number format

Why don't use the Default Properties>Number format>Number(Custom) and set the Decimal places into zero, then the data will be showed just like the round function afterwards.

• ###### 14. Re: Number format

Jack, it should always be "Rounded Up" except anything more than 100 will be 100.

Example:  50.11 ----> 51,

50.66----> 51

0.23---->1

100.99----->100

70.22---->73

80.99--->81

1 2 3 Previous Next