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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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)