I have a field that I need to be displayed as a percentage or currency or a straight number. To do this I have added a field to my view determining if a percent sign is needed or dollar sign etc. I then have the following calculated field purely for display:
if [percentornot] = 'percent' then str(round([MonthActual],2)) + '%'
else '$' + str(round([MonthActual],2))
end
however display is as follows:
Support suggested I upgrade my version of desktop which I did but still no resolution to the rounding dilemma.
Packaged workbook attached.
Hi Julia,
Edit the calculation so that it looks like the following--using the round function with an extract can cause some rounding issues (as you've noticed):
if attr([percentornot]) = 'percent' then (str(attr([MonthActual]) )) + '%'
else '$' + (str(attr([MonthActual])))
end
Hope this helps!
-Tracy
Become a Viz Whiz on the Forums! Support the Community and master Tableau.