Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem In Expression Defination regarding Avg() function

Hi Everyone,

I have one problem regarding average function in Expression Defination. when i am defining  if(SALARY > 16500,SALARY,0) then it is giving the expected output.but when i am using  if(SALARY > Avg(Salary),SALARY,0)  then nothing is apearing in the output ....

I am unable to find the solution of this problem so far.....

Can anybody tell me why it is not working ????????

Regards

Sarfaraz

+91 -7620140822

4 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

if(SALARY > Avg(TOTAL Salary),SALARY,0)


Regards,

Jagan.

mdmukramali
Specialist III
Specialist III

Dear Sarfaraz,

Try to store the Avg(SALARY) into a variable.

vAvgSal= Avg(SALARY)

then try the below expression

=  if(SALARY > $(vAvgSal) ,SALARY,0)

Thanks,

Mukram

Not applicable
Author

Thanks a lot Mr.Jagan......Your solution is working as expected.

Can you please explain me about this Avg(Total SALARY)...What actually hapening in this ....so that it will be good for me from knowledge perspective....

Regards

Sarfaraz


jagan
Luminary Alumni
Luminary Alumni

Hi,

TOTAL ignores all the dimensions in the chart, so you will get the overall average, if you do not use TOTAL then you will get the row wise Average.  Hope this helps you.


Please close this thread if you go the solution.


Regards,

Jagan.