Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Showing only products with multiple categories

I have a current situation where right now, I have the following setup

Products     Categories

A                     1

A                     2

A                     3

B                     1

B                     3

C                     1

D                     1

I want to display, for viewing, all the products that are in 2 or more categories only. I do not want to display products in just one category. In the above example, a table showing only:

Products A and B. Then I will have additional expressions after that tied together for products A and B but the users would never see C and D in this view.

This is used for error checking (products should not be in more then 1 category but may somehow).

I can do this in expressions but I am running in to a road block trying to figure out how to eliminate the dimensions.

Any ideas? I've searched but can't find to much.

2 Replies
Anonymous
Not applicable
Author

Hi,

You could use a calculated dimension like:

=aggr(if(Count(Products)>1,Products),Products)

Then use an expression to count the products: Count(Products)

And click Suppress when value is null on the dimension tab. This should give you:

A 3
B2
Not applicable
Author

=aggr(if(Count(Products)>1,Products),Products)

Won't I want it to be:

=aggr(if(Count(Categories)>1,Products,''),Products)

Then I can suppress the values at null? 

Maybe I'm missing something as I am just trying to learn set analysis.

I do get the general idea though.