KNOWLEDGE BASE

Changing What Symbol the Parameter Shows


Published: 21 Mar 2013
Last Modified Date: 22 Apr 2016

Question

Change what symbol the parameter shows. For example one measure in a parameter should show values with the  percentage symbol, and another measure should show values with the currency symbol.

Environment

Tableau Desktop

Answer

This answer assumes you have already created a parameter to toggle between two different measures. Refer to the attached packaged workbook to see this example.

1. Select Analysis > Create Calculated Field
2. In the Formula text box, type a formula similar to the following: 

case [<measure-parameter-field>]
when '<measure1>' then left(str(avg(measure1)*100), 3) + "%"
when '<measure2>' then "$" + (if sum(measure2)>99999 then left(str(sum(measure2)), 3) + "," + mid(str(sum(measure2)), 4, 3) end)
end


2. Drag the calculation to Text.
Did this article resolve the issue?