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: 
tomovangel
Partner - Specialist
Partner - Specialist

Aggr or max ?

Hello guys, I am relatively new to Qlik Sense, and I have been struggling this past few hours with the following problem:

I have a table from Qlik Connectors which gives me sub_name( hour of the day) and value( number of online fans( from my FB page))Screenshot_1.png
I want to get the maximum value, and the corresponding hour to it,
I tried using Aggr(Max(value),sub_name) but it doesn't work

My end result should be
Max online fans are at 11 - 285.

I have thought of the peek function, but I am not sure

Any help will be highly appreciated.

-Angel

1 Solution

Accepted Solutions
pathiqvd
Creator III
Creator III

Hi,

Try this,

=FirstSortedValue(DISTINCT sub_name,-Value&sub_name)&'-'&max(Value)

Regards,

View solution in original post

17 Replies
devarasu07
Master II
Master II

Try like this,

=max(total aggr(sum(value), sub_name))

jonathandienst
Partner - Champion III
Partner - Champion III

To get the sub_name with max value:

FirstSortedValue(sub_name, -value)

The maximum value:

Max(value)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tomovangel
Partner - Specialist
Partner - Specialist
Author

this gives me 180 600 ( which is the sum of all days)
It doesn't work...

tomovangel
Partner - Specialist
Partner - Specialist
Author

the Max(value) gives me the maximum value, but it doesn't give me the sub_name...

and FirstSortedValue(sub_name, - value) returns 2 ( which is not right)

antoniotiman
Master III
Master III

Hi Angel,

You need to Aggr per Date, like this

Aggr(FirstSortedValue(DISTINCT sub_name,-value),end_date_pacific)

Regards,

Antonio

tomovangel
Partner - Specialist
Partner - Specialist
Author

Nope, This returns    -

...

-Angel

pathiqvd
Creator III
Creator III

Hi,

Try this,

=FirstSortedValue(DISTINCT sub_name,-Value&sub_name)&'-'&max(Value)

Regards,

antoniotiman
Master III
Master III

Where You want to use expression ?

If in Text Box then add Max( to previous expression.

tomovangel
Partner - Specialist
Partner - Specialist
Author

Thanks, this is giving me 

10 - 334 ( which is what I expected, I am going to check if it is correct)
Thank you Iakshmipathi p !

Regards,l

Ange