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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
LEGION
Contributor II
Contributor II

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
MVP

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
MVP

You could try this:

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

or maybe this:

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

- Marcus

LEGION
Contributor II
Contributor II
Author

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