Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Expression

Hi Friends,

 

I have a pivot table in my attached Qv  file. In this pivot table I have two exprression

Exp 1      SUM(NRP)

Exp 2      IF(DAILY_NRP>(NRP),SUM(NRP),SUM(DAILY_NRP))

I am expecting same total Value from both of these expression but it gives two different values. May be My Exp 2 is incorrect But I want to use Exp2 in my Pivot table. Therefore Kindly help me to correct my Exp 2.. I have attached the file pls

Labels (1)
2 Solutions

Accepted Solutions
tresB
Champion III
Champion III

Try this as 2nd exp:

Sum(IF(DAILY_NRP>NRP,NRP,DAILY_NRP))

View solution in original post

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You need to either use sum in the test in the if statement as well:

IF(sum(DAILY_NRP)>sum(NRP),SUM(NRP),SUM(DAILY_NRP))

Or you need to move the if inside the sum: sum(if(DAILY_NRP>NRP,DAILY_NRP,NRP). If that's what you need then replace the if with a rangemax: sum(RangeMax(DAILY_NRP,NRP))

 


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
tresB
Champion III
Champion III

Try this as 2nd exp:

Sum(IF(DAILY_NRP>NRP,NRP,DAILY_NRP))

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You need to either use sum in the test in the if statement as well:

IF(sum(DAILY_NRP)>sum(NRP),SUM(NRP),SUM(DAILY_NRP))

Or you need to move the if inside the sum: sum(if(DAILY_NRP>NRP,DAILY_NRP,NRP). If that's what you need then replace the if with a rangemax: sum(RangeMax(DAILY_NRP,NRP))

 


talk is cheap, supply exceeds demand