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

1 out of 5 chart

Hi.

You got five products (1 2 3 4 5) - Each has its own button. When you select one product a chart will display the numbers of customers who got:

  • only that product
  • That product and One other product
  • That product and Two other products
  • That product and Three other products
  • That product and Four  other products

The logic is this:

Selected product - Only that one

(2) Selected product - 1 or 2 or 3 or 4

(3) Selected product - 1 or 2 or 3 or 4  AND 1 or 2 or 3 or 4

(4) Selected product - 1 or 2 or 3 or 4 AND 1 or 2 or 3 or 4 AND 1 or 2 or 3 or 4

(5) Selected product - 1 or 2 or 3 or 4 AND 1 or 2 or 3 or 4 AND 1 or 2 or 3 or 4 AND 1 or 2 or 3 or 4

Can anybody help me with the expression, and/or the logic to solve this puzzle?

1 Solution

Accepted Solutions
Not applicable
Author

Maybe like attached. I change the data model a bit and did the calculations on the backend.

Thanks

AJ

View solution in original post

8 Replies
MK_QSL
MVP
MVP

Can you provide some sample data?

Not applicable
Author

Here is some sample data.

It is not the best example, but hopefully it will show the essence of what im going for

Not applicable
Author

It would be very helpful if someone could take a look at this

Not applicable
Author

Anyone?

MK_QSL
MVP
MVP

Let me try... but need your exact result... don't understand what you want to get...

Not applicable
Author

Each person has 1-5 foods. (can have one, or more)

I want to make a chart that displays how many ppl have just one type of food (of any kind), how many people have two kinds if food (of any kind), the three and so on.

Thanks for the help, let me know if you have any questions or I can do anything

Not applicable
Author

Maybe like attached. I change the data model a bit and did the calculations on the backend.

Thanks

AJ

MK_QSL
MVP
MVP

Good Solution provided by Ajay at Script end... But if you want to try at UI end, use as below suggested..

Create a Bar Chart or Straight Table....

Dimension

=Aggr(COUNT(DISTINCT Food),Name)

Expression

COUNT(DISTINCT Name)