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: 
bartwelvaarts
Contributor III
Contributor III

sum(aggr with if

hello friends of the qlik comunntiy,

 

I want to calculate the following  measure only when the if statement is true

sum(aggr(sum(Amount * Price),Month,Article,color) * aggr(avg([percentage),Month,Article,color))

But i do not get the right result, I tried something like this

sum(aggr(if( value ='YES',

sum(aggr(sum(Amount * Price),Month,Article,color) * aggr(avg([percentage),Month,Article,color))),,Month,Article,color))

but this does not work correctly. Does someone have any suggestions?

Labels (2)
1 Reply
MayilVahanan

Hi @bartwelvaarts 

may be try like below

sum(aggr(sum({<value ={'YES'}>}Amount * Price)* avg({<value ={'YES'}>}[percentage)),Month,Article,color))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.