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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
suheshreddy
Contributor III
Contributor III

If with aggregation not working in UI

Hi All,

I am trying to compare a field with an aggregation of another field but I am not successful in doing so, can someone please help me if I am missing something simple in it.

I am using below code 

max(aggr(if(MIN <= (sum({<YEAR = {'2019'}>}SALES)/
((sum({<YEAR = {'2018'}>}SALES)
+sum({<YEAR = {'2017'}>}SALES))/2)),REBATE),PAYER))

 

Below code works but I want it to calculate at each dimension

max({<MIN = {"<=$(= sum({<YEAR = {'2019'}>}SALES)/
((sum({<YEAR = {'2018'}>}SALES)
+sum({<YEAR = {'2017'}>}SALES))/2))"}>}
REBATE)

 

please find the attached sample app for my data set.

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

May be this

Max(Aggr(
If(MIN <= (Sum(TOTAL <PAYER> {<YEAR = {'2019'}>} SALES)/
((Sum(TOTAL <PAYER> {<YEAR = {'2018'}>} SALES) 
+Sum(TOTAL <PAYER> {<YEAR = {'2017'}>}SALES))/2)), REBATE)
, PAYER, MIN))

View solution in original post

2 Replies
sunny_talwar

May be this

Max(Aggr(
If(MIN <= (Sum(TOTAL <PAYER> {<YEAR = {'2019'}>} SALES)/
((Sum(TOTAL <PAYER> {<YEAR = {'2018'}>} SALES) 
+Sum(TOTAL <PAYER> {<YEAR = {'2017'}>}SALES))/2)), REBATE)
, PAYER, MIN))
suheshreddy
Contributor III
Contributor III
Author

It worked.

Thanks,