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

can i write the sum of 2 expressions simpeler or more efficient?

Hello,

i sum 2 expressions together to calculate a value, but in the 2 expressions there are several mutual elements.

Is there a way to write this simpeler and perhaps more effective?

sum ({< ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus= {'On hold'},OnHoldReason={'Treated - waiting for client','Treated - waiting for payment','Treated - waiting for payment'}   >}  OrderQtyOpen*SkuPricePurchaseCurrency) +

sum ({< ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus= {'Placed'}  >}  OrderQtyOpen*SkuPricePurchaseCurrency)

thanx!

Chris

2 Replies
vishsaggi
Champion III
Champion III

Can you tell us what you getting the output value? May be try this?

= sum ({< ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus = P({< OrderStatus = { 'On hold'},

                                                                                  OnHoldReason= { 'Treated - waiting for client',

                                                                                                  'Treated - waiting for payment',

                                                                                                  'Treated - waiting for payment'

                                                                                                }

                                                                                >}OrderStatus

                                                                               ),

          OrderStatus= {'Placed'} >}  OrderQtyOpen*SkuPricePurchaseCurrency)

sunny_talwar

Not sure, but you can try this if the two set analysis doesn't overlap:

Sum({<ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus = {'On hold'}, OnHoldReason = {'Treated - waiting for client','Treated - waiting for payment','Treated - waiting for payment'}>+< ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus = {'Placed'}>}  OrderQtyOpen*SkuPricePurchaseCurrency)