Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Help with expression

Hi, i am trying to get an expression to show me TotalValue of some Stock Movement Reason Codes but excludding some descriptions...

My fields are:

StockValue

Stock movement Reason Code

Narrative

I want the sum of StockValue for Stock Movement Reason Codes '3,5,16,18' but exclude values with a Narrative of either 'WASTAGE' or 'DAMAGED'

I have the following working for the first part..

sum  ( {<[Stock Movement Reason Code] ={3, 5,16,18}>} StockValue)

but i am unsure on how to add the 2nd part.

Can anyone help please?


Thanks

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Sorry wrongly understood your problem.

     Here is the solution

     sum  ( {<[Stock Movement Reason Code] ={3, 5,16,18},Narrative-={'WASTAGE','DAMAGED'}>} StockValue)

Hope it helps

Celambarasan

View solution in original post

5 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check with this,

     sum  ( {<[Stock Movement Reason Code] ={'WASTAGE','DAMAGED'}>} StockValue)

Celambarasan

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks but that doesn't work.

I need it to INCLUDE Stock Movement Reason Code 3, 5,16,18 and EXCLUDE Narratives WASTAGE and DAMAGED.

Thanks

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Sorry wrongly understood your problem.

     Here is the solution

     sum  ( {<[Stock Movement Reason Code] ={3, 5,16,18},Narrative-={'WASTAGE','DAMAGED'}>} StockValue)

Hope it helps

Celambarasan

Anonymous
Not applicable

Hi There,

Try this (assuming Narrative is also a field):

=Sum( {$ <[Stock Movement Reason Code] = {3,5,16,18} , [Narrative] -= {'WASTAGE','DAMAGED'}>}StockValue)

Is this what you are looking for?

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thats great, thanks very much