Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dasaradh
Contributor III
Contributor III

set analysis with aggr function

I am creating variable called guarantee customer

vExpGuaranteecustomers=sum(aggr(if({<"sum({$1})">}={"<=$2"},1,0),CustomerNbr))

and i am using this variable $(vExpGuaranteecustomers(BalanceEur,100000))

but its returning 0

for example a customer has 4 accounts

if he had balance in his accounts less than 100000 he is guarantee customer other wise he is non guarantee customer

so that i am using aggr function like this

sum(aggr(if(sum(BalanceEur)<=100000,1,0),CustomerNbr))

above expression is working correctly how can i make it globally.

so here balanceEur and 100000 changes country wise i want to make it globalize.


can you help me in this.


thanks in advance.


Thanks,

Dasaradh

2 Replies
mohitd910
Creator II
Creator II

Hi Dasaradh,

you have to create only variable for sum(BalanceEur) and use that in the expresion it will work as globally.

use that variable in this instead of sum(BalanceEur)


sum(aggr(if(sum(BalanceEur)<=100000,1,0),CustomerNbr))

dasaradh
Contributor III
Contributor III
Author

I got ans like this

sum(aggr(if(sum($1)<=$2,1,0),CustomerNbr))

in this how can i add another varibale in if clause