Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Adrian1
Partner - Contributor II
Partner - Contributor II

Aggr with mode function

Hello,

I hope somebody can help me with this.

I would like to know how many customers have a certain discount as the most repeated (mode function).

I try this, but it doesnt works:

Count ( Aggr ( mode(Discount), IdCustomer) )

thanks!

Labels (2)
1 Solution

Accepted Solutions
Adrian1
Partner - Contributor II
Partner - Contributor II
Author

Yes you're right.

It works with 

Aggr(mode(Discount), IdCustomer) like dimension

and count(Distinct IdCustomer) like expression

View solution in original post

2 Replies
Lauri
Specialist
Specialist

I suspect that returns the count of IdCustomer, which isn't very helpful. Your Aggr function is returning a list of IdCustomer and their mode. Then your Count function is just counting them.

Are you picking a value of discount in the app, and hoping to see how many customers have that as the most repeated?

Adrian1
Partner - Contributor II
Partner - Contributor II
Author

Yes you're right.

It works with 

Aggr(mode(Discount), IdCustomer) like dimension

and count(Distinct IdCustomer) like expression