Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
chriscools
Creator II
Creator II

Only count SKU's where qty on orderlines is greater than zero

Hello,

i want to count all distinct SKU's based on this:

Count(DISTINCT     {<date={">=$(=VDatumSeizoenHuidigVan)<=$(=VDatumSeizoenHuidigTot)"}>}   sku_code          )

that works but it also gives me SKU's that don't have orderlines associated with them.

How should i need to adapt the count formula so that it only counts those SKU's where below qty is greater than zero?

sum (     {<date={">=$(=VDatumSeizoenHuidigVan)<=$(=VDatumSeizoenHuidigTot)"}>}      (qty_unit-qty_unit_cancelled))

Thanx a lot!

 

chris

1 Solution

Accepted Solutions
tresesco
MVP
MVP

You need to put the same condition in set , like:

Count(DISTINCT     {<sku_code={`=sum (     {<date={">=$(=VDatumSeizoenHuidigVan)<=$(=VDatumSeizoenHuidigTot)"}>}      (qty_unit-qty_unit_cancelled))>0` },

date={">=$(=VDatumSeizoenHuidigVan)<=$(=VDatumSeizoenHuidigTot)"}>}   sku_code  )

 

Note, the back quotes in red. You could use another valid quote though.

 

View solution in original post

2 Replies
tresesco
MVP
MVP

You need to put the same condition in set , like:

Count(DISTINCT     {<sku_code={`=sum (     {<date={">=$(=VDatumSeizoenHuidigVan)<=$(=VDatumSeizoenHuidigTot)"}>}      (qty_unit-qty_unit_cancelled))>0` },

date={">=$(=VDatumSeizoenHuidigVan)<=$(=VDatumSeizoenHuidigTot)"}>}   sku_code  )

 

Note, the back quotes in red. You could use another valid quote though.

 

chriscools
Creator II
Creator II
Author

ok, that worked perfectly!

Thanx a lot!!

 

Chris