Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
LEGION
Contributor
Contributor

SUM IF FIELD IS NOT BLANK

Hello Guys, i need some help please.

I'm Trying to get to a 'Stock Holding Figure' which is simply STOCK x COST but only if the field DEPARTMENT has been filled in. Basically perform the calculation if DEPARTMENT is NOT Blank.

=sum({(<[DEPARTMENT]={"*"} >)} ([Stock.ONHAND]*[Stock.AVRGCOST]))

 

Thank you so much

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer
MVP & Luminary
MVP & Luminary

You could try this:

=sum({<[DEPARTMENT]={'*'} >} [Stock.ONHAND] * [Stock.AVRGCOST])

or maybe this:

=sum({<[DEPARTMENT]={"=len(trim([DEPARTMENT]))>0"} >} [Stock.ONHAND] * [Stock.AVRGCOST])

- Marcus

View solution in original post

2 Replies
marcus_sommer
MVP & Luminary
MVP & Luminary

You could try this:

=sum({<[DEPARTMENT]={'*'} >} [Stock.ONHAND] * [Stock.AVRGCOST])

or maybe this:

=sum({<[DEPARTMENT]={"=len(trim([DEPARTMENT]))>0"} >} [Stock.ONHAND] * [Stock.AVRGCOST])

- Marcus

View solution in original post

LEGION
Contributor
Contributor
Author

Thank you so much, the second line worked like a charm.