Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.
How you have created MonthYear?
like this?
MonthName(Date) as MonthYear?
Did you try with max(MonthYear)?
Sum( {< MonthYear = { '$(=Max(MonthYear)' } > } SomeMeasure )
if you want the latest date according to you data then try MAX(date_filed) or if you want the latest month year then
monthname(today()) as latest_month
It doesn't work
I have the latest month year in my data is jan 2016.
Somehow I need to fix my set analysis to my latest month year(jan 2016) of the data I load.
sample data?
Month Year | Month_row |
---|---|
Apr-15 | 10 |
May-15 | 4 |
Jun-15 | 5 |
Jul-15 | 6 |
Aug-15 | 9 |
Sep-15 | 1 |
Oct-15 | 2 |
Nov-15 | 3 |
Dec-15 | 8 |
Jan-16 | 7 |
In above table, I am trying to get the row number to each month year, so that I can easily fix the max(Month_row) in set analysis, but the issue is in sorting.
If you haven't already a combined Month and Year field in your data model you could do this:
Sum( {< MonthYear = { '$(=Max([Month Year])' } > } SomeMeasure )
I have presumed that your [Month Year] field really is an actual data field in QlikView... isn't that so?
Working same in my case, see the attachment
Also , you can try like this?
monthname(max(DateField)) in your set analysis