Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
cooper_yonk
Contributor III
Contributor III

Set Analysis help

if you get a minute, do you have any idea why this set analysis isnt working

Sum({
<GEP_NEW.PaymentType -= {'Field Fee'},
      GEP_NEW.Amount = {GEP_NEW.PaymentType={'Excess'} * {">0"}}>
} GEP_NEW.Amount)

 

im trying to say, from my dataset exclude 

"PaymentType = Field Fee" 

"PaymentType=Excess  where Amount>0"

Labels (3)
1 Reply
rodrigo_martins
Partner - Creator
Partner - Creator

Hello, I created some simplified data to test your expression. To get your result, I needed a record identifier field, which I imagine you have in your model. This identifier field was necessary to use the P() and E() functions, which return possible records that meet (or not) a set of conditions (documentation and examples).

In the print below I included each step of the calculation, until reaching the final result. The expression looked like this:

Sum({<GEP_NEW.PaymentType-={'Field Fee'}, GEP_NEW.Id=E({<GEP_NEW.PaymentType={'Excess'},GEP_NEW.Amount={">0"}>} [GEP_NEW.Id])>} GEP_NEW.Amount)

rodrigo_martins_0-1714392549531.png

 

I hope it helps.