Nithin NY
Nithin NY

Reputation: 1

How do I change from decimal to whole number and whole number to decimal on a click of a button or action in Tableau?

I have a financial field with decimals present in it. And would like to show the whole number value always but as I click a button or action specific to it, it should show me the decimal value for it.

Upvotes: 0

Views: 1732

Answers (2)

kaz
kaz

Reputation: 134

Steps to convert Decimal to whole number:

  1. Go to value and right click on the value and go into format .

    Refer this link:https://i.sstatic.net/f6ysv.png

  2. After going format Go to fields you want to change format and select it

    Refer this link:https://i.sstatic.net/nQ9No.png

  3. After click on fields Go to Numbers and change format as per your requirement.

    Refer this link:https://i.sstatic.net/2zS2L.png

Note: Refer links to get details of how to do.

Upvotes: -1

spijs
spijs

Reputation: 1529

What you can do is create a parameter as_decimal with two possible values True and False.

You then create a calculated field which is an if-else where in the if expression you check whether the as_decimal parameter is set to True. If this results to true then you 'return' the decimal value else you return the whole value.

Instead of the current value you are showing, you should use the calculated expression.

Upvotes: 2

Related Questions