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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Find maximum frequent number

load * Inline
[Numbers
20
25
35
35
35
44
11
11
55
55
]
;

I have used =max(aggr((count(Numbers)),Numbers))

In text box I want 35 instead of 3. Because number 35 has
repeated 3 times.

Any Idea?

Regards

Vinay


1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

May be something like this....

=Aggr(IF(COUNT(Numbers)=MAX(TOTAL Aggr(COUNT(Numbers),Numbers)),Numbers),Numbers)

or

=Aggr(IF(COUNT(Numbers)=MAX({1}TOTAL Aggr(COUNT({1}Numbers),Numbers)),Numbers),Numbers)

View solution in original post

11 Replies
MK_QSL
MVP
MVP

May be something like this....

=Aggr(IF(COUNT(Numbers)=MAX(TOTAL Aggr(COUNT(Numbers),Numbers)),Numbers),Numbers)

or

=Aggr(IF(COUNT(Numbers)=MAX({1}TOTAL Aggr(COUNT({1}Numbers),Numbers)),Numbers),Numbers)

CELAMBARASAN
Partner - Champion
Partner - Champion

Did you tried with the function called "Mode"

Mode(Numbers)

But it will give you null when morethan one value is in first place.

Like if you add one more 55 to your list, it will results you null value.

Not applicable
Author

Hi Vinay,

use the Count() Function.Refer the attached QVW File.

Not applicable
Author

Hi Manish,

Thanks for reply and its working.You are really a GURU.

Regards

Vinay


anbu1984
Master III
Master III

In Script

Load FirstSortedValue(Numbers,-Cnt);

Load Numbers,count(Numbers) As Cnt Group by Numbers;

load * Inline

[Numbers

20

25

35

35

35

44

11

11

55

55

];

MK_QSL
MVP
MVP

Use this if you have more than one Numbers are appearing in TOP position...

=CONCAT(Aggr(IF(COUNT(Numbers)=MAX({1}TOTAL Aggr(COUNT({1}Numbers),Numbers)),Numbers),Numbers),',')

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Celambarasan Adhimulam

The previous posted solutions also don't work if more then one value shares first rank. This expression will work for that case:

=FirstSortedValue(DISTINCT Numbers,-aggr(count(Numbers),Numbers))

-Rob

MK_QSL
MVP
MVP

What about second solution given !!!

Rob, I tried a lot but it's not working.

If I want the answer 35 should be there even though if user select any Numbers...how can we achieve?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Manish,

Sorry, I missed your second solution. To ignore selections in my expression just add the {1}

=FirstSortedValue({1}DISTINCT Numbers,-aggr(count({1}Numbers),Numbers))

-Rob