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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Display the max(total MonthName)

Hi,

I have a list that has a month number and MonthName

e.g.   MonthNum         MonthName

          11101                Jul

          11102                Aug

          11103                Sep

When a range of months is selected e.g. July to September I want the title of the report to say "Sep YTD Report" using the max(total) function to determine the most recent month selected.

so using max(total MonthName) I get nothing whereas using max(totalMonthNum) will give 11103.

Can this be done for non numeric values like month names?

Thanks

David

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hm, without testing, this might work:

=maxstring(aggr(dual(MonthName, Max(MonthNum)), MonthNum))

Not sure if it's a bit overkill though and there's likely an easier way but this was the first thing that popped in my mind.

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Try just max(MonthName)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Hm, without testing, this might work:

=maxstring(aggr(dual(MonthName, Max(MonthNum)), MonthNum))

Not sure if it's a bit overkill though and there's likely an easier way but this was the first thing that popped in my mind.

Not applicable
Author

Hi,

EDITED: I replied saying it didnt work at the same time the correct answer was posted

Thanks Johannes that worked perfectly

The max(MonthName) didn't work sorry.

Thanks

David