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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Help writing expression

Hi all,

I am trying to write an expression to give me WASTE as a % of SALES.

The calculation is:

StockValue / SalesValue

but i need it to exclude any selections made from the field [Stock Reason], so this is what i have so far which seems to work

Sum(StockValue)/Sum({$<[Stock Reason] = >}SalesValue)

But i also need to exclude any sales from DEPT = U .

This is where i am having problems, can anyone help me to write the expression to do all of the above?

so..

StockValue needs to be divided by SalesValue excluding Dept U and ignoring selections from StockReason

Any help woulf be appreciated..

Thanks

Labels (1)
1 Solution

Accepted Solutions
Not applicable

Hi

try this :

Sum(StockValue)/Sum({$<[Stock Reason]=, DEPT-={'U'}>}SalesValue)

Regards

Gills

View solution in original post

2 Replies
Not applicable

Hi

try this :

Sum(StockValue)/Sum({$<[Stock Reason]=, DEPT-={'U'}>}SalesValue)

Regards

Gills

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks very much Gills..