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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with Expression

Hi,

Not sure if this is possible; I am trying to create a conditional expression to sum the values based on the Product_Unit.

So if Product_Unit='CBM', sum CBMUnit, else sum OtherUnit.

Is this possible?

sum({$<Product_Unit={CBM}>} CMBUnit)

Product_UnitCBMUnitOtherUnit
CBM50
CBM50
KG02
KG02
KG02

thanks

Derrell

6 Replies
Not applicable
Author

try this:

sum({$<Product_Unit={'CBM'}>} CMBUnit)

Anonymous
Not applicable
Author

Sum(Pick(WildMatch(Product_Unit, 'CBM')+1, OtherUnit, CBMUnit))

Anonymous
Not applicable
Author

Try this:(it happened for me and below worked)

=(if(Product_unit='CBM', Sum({<Product_unit={'CBM'}>} CBM_unit),Sum(Other_unit)))

This will work.

if not try this.

=(if(Product_unit='CBM', Sum({<Product_unit={'CBM'}>} Total <Product_unit> CBM_unit),Sum(Total <Product_unit> Other_unit)))

Hope this helps.

Regards,

Chinna

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this using two Sum()


=Sum({<Product_Unit={'CBM'}>} CMBUnit) + Sum({<Product_Unit-={'CBM'}>} OtherUnit)


Note : The above expression is shown as syntax error near -=, but it works ignore that error.


Regards,

Jagan.

jagan
Partner - Champion III
Partner - Champion III

or you can just simply give

Sum(CBMUnit + OtherUnit)

because if Product_Unit=CBM you have the other Unit as 0 and vice versa.  So this also works.

Regards,

jagan.

Not applicable
Author

HI,

This should be work.

Sum(CBMUnit + OtherUnit)


Priyantha