1 2 Previous Next 19 Replies Latest reply on Jun 22, 2018 11:15 AM by Deepak Rai

format in the calcultaion

Can we format a number in a calculated field ?

Let's say, I have an object called 'X'. I want to show this one point after decimal. I have another object called 'Y'. I want to show round figure in million.

Can we do that ?

• 1. Re: format in the calcultaion

Have a look Pl:

Thanks

Deepak

• 2. Re: format in the calcultaion

It doesn't tell anything about the number format. I already looked into that.

• 3. Re: format in the calcultaion

Then post some dummy workbook pl.

• 4. Re: format in the calcultaion

Come on.

Can you convert any numerical number to it's desire number format using calculated field ?

Let's say, I have an object called X. It has value like: 1.111, 1.222, 1.333, 1.454, 1.112. I want to write a formula in the calculated field which will show only one digit after decimal. Like: 1.1, 1.2, 1.3 etc.

• 5. Re: format in the calcultaion

ROUND(SUM(Value),1)

Guessing

• 6. Re: format in the calcultaion

The result of your solution is:

It does not remove zero. It just rounds to the one decimal point. I need  to show only one digit after decimal.

• 7. Re: format in the calcultaion

You can format the measure.

Just use custom number and put in 1 Decimal place. For the display in million use the Display units

• 8. Re: format in the calcultaion

Eva, not that easy. I want it inside a formula. This is just one part of a case statement. One should show one digit after decimal, another one two digits after decimal, others should show data in millions with sign 'M'.

• 9. Re: format in the calcultaion

Does it need to stay as a number?

Otherwise you could maybe use strings instead and round as you need it (1 or 2 decimal placed) and for the million divide it by 1,000,000 then add 'M' in the end.

If you still need the number to eg colour you can make two fields and use the string only for display while you still have a field to use the actual values.

I doubt that Tableau has formatting in the calculated field itself.

• 10. Re: format in the calcultaion

Can you give me an example of string ? How will you capture after decimal ? It should be untouched before decimal.

• 11. Re: format in the calcultaion

I Don't know what do you mean , but I am getting Correct Result with Formula I gave u

Thanks

Deepak

• 12. Re: format in the calcultaion

It doesn't work. Still trying hard.

Case [Select an Attribute]

WHEN "IRR" THEN ROUND([ATTR GrossIRR],1)
WHEN "TVPI" THEN ROUND([ATTR GrossTVPI],2)
WHEN "DPI" THEN ROUND([ATTR GrossDPI],2)
WHEN "RVPI" THEN ROUND([ATTR GrossRVPI],2)
WHEN "Paid In" THEN [ATTR TotFunding]
When "Distribution" THEN [ATTR TotDist]
When "NAV" THEN [Attr Nav]
When "Total Value" THEN  ([Attr Nav]+[ATTR TotDist])
When "Total Gain" THEN [ATTR TotGain]
END

• 13. Re: format in the calcultaion

ATTR is the original column name, not Tableau ATTR function.

• 14. Re: format in the calcultaion

We would have solved it with a workbook, If possible create a dummy

1 2 Previous Next