Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
tanphat911
Contributor II
Contributor II

Count total group by customer

Hello All,

I am new to Qlik , Hope you can support me to this scenario.

I have table Customer & Group.

For Example:

Customer A - Group 1

Customer A - Group 2

Customer A - Group 3

Customer B - Group 1

Customer C - Group 2

I would like to have output to visual on chart

Total Customer Belong to 3 group : 1

Total Customer Belong to 1 group : 2

 

I have write some script like 

sum( Aggr(count(distinct(group)),customer))

Customer A, 3

Customer b,1

Customer c,1

But i don't know how to do next for other count

3 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @tanphat911 ,

Have you tried 

sum( Aggr(count(distinct(customer)),group)).

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
tanphat911
Contributor II
Contributor II
Author

Hi @abhijitnalekar ,

 

Total Customer Belong to 3 group : 1

Total Customer Belong to 1 group : 2

 

So for get Dimension Total Customer Belong to 3 group  .

How  I can get this ?

tanphat911
Contributor II
Contributor II
Author

nvm, I found solution 😄

I will create a new dimension calculated by

=if(Aggr(count(distinct(bu)),cust_key) >= 3,'>=3'
,if(Aggr(count(distinct(bu)),cust_key)= 2,'2'
,if(Aggr(count(distinct(bu)),cust_key)= 1,'1',0)))