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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Set Expression

Hi Friends

My following expression does not return a value

=SUM(IF(Aggr(SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)/SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM),CRE_NAME_1)>.1,SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)))

Pls advise where I have made the error

8 Replies
swuehl
MVP
MVP

What do you want to achieve?

Maybe

=IF(

Sum(Aggr(SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)/SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM),CRE_NAME_1)) >.1

,SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)

)

Otherwise there are two issues: the condition is only true if your comparison returns same result for all CRE_NAME_1 and the THEN branch is an aggregation embedded into another.

upaliwije
Creator II
Creator II
Author

    Hi

I want to show in my Pivot table only A,B,F where % is >.1. My Calculation is Individual Fin_premium/ Total FIN_Premium

Screenshot_2.png

Kushal_Chawda

also try this

=sum(aggr(IF(SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)/SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)>.1,SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)),CRE_NAME_1))


or


=SUM(aggr(IF(Aggr(SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)/SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM),CRE_NAME_1)>.1,SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)),CRE_NAME_1))

upaliwije
Creator II
Creator II
Author

Both of Your expression works but none meet me condition of  .1

swuehl
MVP
MVP

Won't you Need a TOTAL qualifier in the denominator of your division? Looks like the division is constant 1.

upaliwije
Creator II
Creator II
Author

Kindly modify the expression and show

swuehl
MVP
MVP

Maybe

=Sum(

Aggr(

IF(

SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM) / SUM(TOTAL {<RISK_DATE={$(vP16)}>}FIN_PREMIUM)>.1

,SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)

)

,CRE_NAME_1)

)

Kushal_Chawda

It's not working because you have another expression %, in that expression also you need to write the if condition

aggr(IF(SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)/SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)>.1,

SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)/SUM({<RISK_DATE={$(vP16)}>}FIN_PREMIUM)),CRE_NAME_1)