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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to return the Dimension of Aggr()

Hi friends,

I have a histogram as per below, which shows the number of calls by day of week:

Dimension: WeekDay

Measure: Sum( Calls)

Capture.PNG

Now, I want to write an automated commentary. In the commentary,  I want to refer to the largest dimension.

I want to say:      " Saturday was the busiest day "

How can I write a script which returns Saturday ?


This function  Max (  Aggr ( Sum(Calls) , WeekDay)  ) returns 82, but I want to get its corresponding dimension (Sat).

Could you please help?

Thank you.

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

try

FirstSortedValue(  WeekDay, -Aggr ( Sum(Calls) , WeekDay)  )

View solution in original post

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

try

FirstSortedValue(  WeekDay, -Aggr ( Sum(Calls) , WeekDay)  )

Anonymous
Not applicable
Author

Great Dilip.

Thank you very much for your quick help.

i appreciate it.