2 Replies Latest reply on Aug 28, 2017 1:15 PM by Indre White

# Limit percentage displayed on calculated field v10.3

Hi guys,

Not sure if anyone had this issue before, I am using calculated field for variance %, and although the percentages are correct, I want to show maximum 100% or -100%, even if percentage change is 500% - I need to display 100%  as maximum or negative 100%.

I am using the percent_variance formula  (ZN([Expense PMPM]) - LOOKUP(ZN([Expense PMPM]), -1)) / ABS(LOOKUP(ZN([Expense PMPM]), -1))

How this can be done in tableau?

thank you

• ###### 1. Re: Limit percentage displayed on calculated field v10.3

Hi Indre,

Maybe not the most elegant solution, but you can create a calculated field like this:

if [Percent Variance]>1 then 1

elseif [Percent Variance]<-1 then -1

else [Percent Variance]

END

It should accomplish what you're looking for.

Does this help?

Michael

1 of 1 people found this helpful
• ###### 2. Re: Limit percentage displayed on calculated field v10.3

thank you Michael, yes that helps.