Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

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

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.