Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
johnso2080
Contributor
Contributor

Aggregation

Hello,

I'm trying to get a count of how many product variants are out of stock on a given week.

However, I only want to include variants that belong to a product that DOES have stock (in other variants) in the same week...

An example table would be..

tbl.JPG

I would expect the results to be..

result.JPG

Hope this makes sense. Any advice would be much appreciated!

Thanks

Darren

4 Replies
Not applicable

DIMENSION--

week

=IF(product='A' OR product='C' OR product='E',product)   

stock

NOTE-- SELECT THE SECOND DIMENSION AND CHECK ON SUPRESS NULL VALUE

EXPRESSION--

if(stock=0, count(varient))

then output like this

weekPRODUCTstockvarient
1A03
2C01
3E01

SEE ATTACHEMENT

johnso2080
Contributor
Contributor
Author

Hello,

This will only give me the count of variants each week.

What I need is the count of variants that have 0 stock, but belong to a product that DOES have stock (in other variants)...

Hope this is clear

Thank you!

er_mohit
Master II
Master II

try this

Aggr(count({$<Stock={'0'}>}Variant),Product)

or this

Aggr(Count( {$<Stock = E({$<Stock={'0'}>})>}Product),Product)

johnso2080
Contributor
Contributor
Author

Thanks for your help.

It's getting close, but not quite worked how I wanted. I've attached the example. It gives me 2 in week 1, but this should be 3...? Any ideas..?

Thanks

Darren