2 Replies Latest reply on Oct 24, 2017 5:05 PM by Zhouyi Zhang

# Parameters in aggregated Calculations

I am trying to include a parameter in a caculation that contains an if condition

My data looks like this

 Location Associate Salary A John 76865.2829 B Jim 87061.60662 C Jill 46917.90774 A Jack 46132.38815 C Jeff 44400.90168 B Joe 69853.01512

I have 2 parameter, lets say "A_input" and "B_input". Calculation i am looking for is:

if Location = "A" then

Avg(Salary) * [A_input]

elseif Location = "B" then

Avg(Salary) * [B_input]

else Avg(Salary)

I am not getting this to work. I keep getting mixing aggregated and non aggregated values. How can i solve this?

• ###### 1. Re: Parameters in aggregated Calculations

if Location = "A" then

Avg(Salary) * ATTR([A_input])

elseif Location = "B" then

Avg(Salary) *ATTR( [B_input])

else Avg(Salary)

End

• ###### 2. Re: Parameters in aggregated Calculations

Hi, Vijaymakesh

IF ATTR([Location]) = "A" THEN

AVG([Salary])* [A_input]

elseif ATTR(Location) = "B" then

Avg(Salary) * [B_input]

else Avg(Salary)

END

Hope this could help

ZZ