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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
khalander
Creator II
Creator II

max monthyear in calculated dimension

Hi,

I have written below expression in calculated dimension to get max month year but getting all months in dimension.

=aggr(max(monthyear),monthyear)

Please do the needful.

Regards,

Khalander

Labels (1)
10 Replies
Anil_Babu_Samineni
MVP
MVP

Try to use?

=aggr(max(TOTAL monthyear),monthyear)

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
khalander
Creator II
Creator II
Author

Hi Anil,

It is giving max month year but not get correct values for maximum month

Anil_Babu_Samineni
MVP
MVP

Image please

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
Clever_Anjos
Support
Support

=aggr(max(monthyear),monthyear) will aggregated for every monthyear and calculating the max(monthyear), so that´s correct retrieving all monthyear

try with

max(monthyear)

khalander
Creator II
Creator II
Author

Hi Anjos,

It is showing error in calculated dimension message if i am giving max(monthyear)

Anil_Babu_Samineni
MVP
MVP

Max() won't work in calculated instead why can't you write in expression and promote them to dimension place?

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
tresB
Champion III
Champion III

It should even work without aggr(), like max( TOTAL monthyear) . If your monthyear is a dual field, this expression should work; you might want to format it like = monthname(max(total monthyear))

Clever_Anjos
Support
Support

try with

=max(total monthyear)

khalander
Creator II
Creator II
Author

Yes It is giving max monthyear if i used total word  but my expression values is coming total values instead of max month values