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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
stjernvd
Partner - Creator
Partner - Creator

Return text value for Max(Month)

Hey,

I would like to do this:

  Date(Date#([Date],'DD-MMM-YY'),'DD MMM YYYY') as Day,
Month(Date(Date#([Date],'DD-MMM-YY'),'DD MM YYYY') ) as Month,
Year(Date(Date#([Date],'DD-MMM-YY'),'DD MM YYYY')) as Year

My months are May, June, and July.

When I do Max(Month), I get 7, how do I get it to return Jul?

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Or

=Month(Max(TradeDay))

View solution in original post

6 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Something like this?

=Date(Max(TradeMonth), 'MMM')

alexandros17
Partner - Champion III
Partner - Champion III

SubField(MonthNames,';',Max(TradeMonth))

let me know

swuehl
Champion III
Champion III

Or

=Month(Max(TradeDay))

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Or this?

=Capitalize(SubField(MonthNames, ';', Max(TradeMonth)))

swuehl
Champion III
Champion III

BTW, there is no need to format a date value using Date() function if you want to further transform it to month or year value:

Month(Date#([TradeDate],'DD-MMM-YY') ) as TradeMonth,
Year(Date#([TradeDate],'DD-MMM-YY') ) as TradeYear

should be enough.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Please note that Stefan's solution returns the Month of the latest date and not the Maximum Month overall (as you seemed to require)

Best,

Peter