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

If Condition equals true - -> Sum Column of same ID

Hello everyone,

I want to sum up the scrap from all the orders that have gone through all the operations.

I have tried as follows:

sum(aggr(max({<OP= {'40'}, Status = {'True'}>} Scrap), Order))

so I only get the one row of data where the condition is true. But I want to know the order ID where the last operation is true and then add up the column scrap.

does anyone have an idea of how to do this?

thanks a lot in advance!

 

OrderOPGoodScrapStatus
1101000True
 201000True
 309010True
 40900True
210700True
 206010True
 30600True
 405010False

the solution would be 10. because only order 1 is finished yet.

3 Replies
Taoufiq_Zarra

Hi,

If I understood correctly, one solution :

=Sum({<Order={"=Match(right(concat(OP&Status,''),6),'40True')>0"}>} Scrap)

 

output :

Capture(1).PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
rohi__
Contributor III
Contributor III
Author

HI @Taoufiq_Zarra ,

thank you for your fast reply!

when I implement this formula it only evaluates the data series where this condition is true. but I need the sum over the whole column scrap.

thanks again!

Kushal_Chawda

try this

sum({<Order = p({1<OP={'40'},Status={'True'}>}Order)>}Scrap)