Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

johnso2080
New 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

Tags (2)
4 Replies
Not applicable

Re: Aggregation

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
New Contributor

Re: Aggregation

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
Honored Contributor II

Re: Aggregation

try this

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

or this

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

johnso2080
New Contributor

Re: Aggregation

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

Community Browser