Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
AlexWest
Creator
Creator

Count Products and group by ID

Hello, guys!

I have a table:

ID Product
1 Swimming
2 Swimming
1 Crossfit
3 Swimming
3 Running
2 Power lifting
1 Power lifting
2 Running
2 Spa

So as we can see:

ID 1 has 3 Products,

ID 2 has 4 Products,

ID 3 has 2 Products.

Avarage, it's 3 products for 1 ID.

Question is: How can I calculate this task in KPI chart, find avarage count of Products by 1 ID (if I have thousands of IDs and several Products)?

Please help with that)

Thanks!

Labels (3)
2 Solutions

Accepted Solutions
tresesco
MVP
MVP

=Avg(Aggr(Count(ID), ID))

View solution in original post

AlexWest
Creator
Creator
Author

Thank you so much!

I didn't know that func before)

But as I understood correct, I edited your expression: Avg(Aggr(Count(Product), ID))

View solution in original post

2 Replies
tresesco
MVP
MVP

=Avg(Aggr(Count(ID), ID))

AlexWest
Creator
Creator
Author

Thank you so much!

I didn't know that func before)

But as I understood correct, I edited your expression: Avg(Aggr(Count(Product), ID))