Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Finding the max value of a column

I have One column Age in my excel.

<18

18 to 24

25 to 34

35 to 44

45 to 59

and i want to know about the maximum occurrence of Age.

Lets Say 

< 18 : 2

18 to 24: 4

25 to 34: 1

35 to 44 : 3

45 to 59: 8

60+ :

So i want to know to get the max value out of Age... Like in this case the answer will be 8 corresponding to 45 to 59 age group...

So just by writing max(Age) its giving me 60+ which acc to logic is fine. But what if I want the function to consider the corresponding values and bring out the max in them

1 Solution

Accepted Solutions
Anil_Babu_Samineni

May be use this?

Capture.PNG

='Maximum no is  ' & Count({<Age = {'$(=FirstSortedValue(Age, -Aggr(Count(Name),Age)))'}>} Name)  & ' and it falls in Age Category '  & FirstSortedValue(Age, -Aggr(Count(Name),Age))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

9 Replies
Anil_Babu_Samineni

You are getting values like 2, 4, 1, 3, 8. You have to provide this for Max like Max(Expression for those values)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

something like Max(aggr(Max(age),yourfield))??

Kushal_Chawda

can you please share the sample data with expected output?

annafuksa1
Creator III
Creator III

you need to create chart with age brackets as dimension and use function max as expression

Anonymous
Not applicable
Author

I need an Text object expression which gives me the output like:

Insights: Maximum No.  is 8 and its fall in Age Category: "45 to 59"

Anil_Babu_Samineni

May be use this?

Capture.PNG

='Maximum no is  ' & Count({<Age = {'$(=FirstSortedValue(Age, -Aggr(Count(Name),Age)))'}>} Name)  & ' and it falls in Age Category '  & FirstSortedValue(Age, -Aggr(Count(Name),Age))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thank you very much Anil. You save my day

Anil_Babu_Samineni

I am glad i was able to help you

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Kushal_Chawda

you can optimize your expression of maximum number expression as below. Age category expression is fine as what suggested by Anil

=FirstSortedValue(aggr(Count(Age),Age),-aggr(Count(Age),Age))