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: 
Not applicable

Help needed on Max(Month)

Hi All,

Hope all are doing good...

I need your help to solve one of the issue that i am facing.

I have a date field in DD/MM/YYYY and i have retrieved Month and Year from that field.

Now the issue is that when i am writing the Max(Month) expression to select Maximum month it is returning Month number instead of Month Name.As a result the value is not getting selected in the month field.

However I have used Month(Max(Date)) to get maximum month and i am able to select maximum month with that expression.

But at the same time for YTD calculation i have used Sum({<Year={"$(=Max(Year))"},Month={"$(=Month(Max(Date)))"}>}Sales) which returning '0'.

Please help me with the correct approach to resolve the issue.

Thanks in advance.

Best Regards,

Nani

16 Replies
Anonymous
Not applicable
Author

Yep, it will work as you have ignored Year & Month not Date

sunny_talwar

Yes, I am certain it will and reason is by making selection in year and month, your max date will also change which will drive this expression

sunny_talwar

It seems you are looking for a YTD expression and not MTD. For YTD, try this:

Sum({<Date = {"$(='>=' & Date(YearStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(MonthEnd(Max(Date)), 'DD/MM/YYYY'))"}Year = ,Month = >}Sales)

Not applicable
Author

Thanks Balraj and Sunny.

I will try these options.

Anonymous
Not applicable
Author

It seems either we did not get you or you are not able to explain.

Check these threads, will help you a lot..

Set Analysis for Rolling Periods

Set Analysis for certain Point in Time

Colin-Albert
Partner - Champion
Partner - Champion

How has your Month data been created? It should be a dual field with both text and number parts.

Can you create a chart with Month as a Dimension and Num(Month) and text(Month) as Expressions.

If you dates are dual you will have both numeric and text values.

Not applicable
Author

Thanks Sunny. It worked for me.

Thanks Balraj and all for your valuable inputs.