Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
karthikeyan1504
Creator III
Creator III

How to get max of month year?

Hi,

I have a date field in the main table. I have derived the month year from the main table using the default master calendar script.

Now I need to get the latest month-year for my set analysis expressions.

Could anyone please advise me to get the latest month-year?

Thanks & Regards,

Karthikeyan.

18 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

you can simply use the below set analysis expression for this,

=Sum({<Year=, Month=, Date={'>=$(=MonthStart(Max(Date)))<=$(=MonthEnd(Max(Date)))'}>} Sales)

Hope this helps you.

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

Check for similar set analysis expressions from below link

Set Analysis for certain Point in Time


Set Analysis for Rolling Periods


Regards,

Jagan.

karthikeyan1504
Creator III
Creator III
Author

Hi Jagan,

It's working perfectly, but I still have difficulty to get the value of last month year value.

Subtracting with -30 or -31 will be difficult in set analysis.

Thanks & Regards,

Karthikeyan.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Use below to get last month value

=Sum({<Year=, Month=, Date={'>=$(=MonthStart(Max(Date), -1))<=$(=MonthEnd(Max(Date), -1))'}>} Sales)


Regards,

Jagan.

karthikeyan1504
Creator III
Creator III
Author

Hi Jagan,

I have got the sales value for last month year. I need to display the month year such as 'Dec-15' vs 'Jan-16' below the KPI to indicate.

jagan
Luminary Alumni
Luminary Alumni

Hi,

I am not sure what you are trying to do.  How you want to display the values?

Regards,

Jagan.

karthikeyan1504
Creator III
Creator III
Author

I am sorry... I have got confused. I have got it from the above expression itself

Thanks much for your help!!!

jagan
Luminary Alumni
Luminary Alumni

Ok fine.

Regards,

Jagan.

anushahegde
Contributor III
Contributor III

You saved me. Thanks!!