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: 
mariamovasheli
Contributor III
Contributor III

Max date Month for Years

I Use This formulas to show max date for 3 years but I need to show max Month not date and how Should I change it to achieve my goal?

Date = {"=SetDateYear(Only({1} Date), Year(Today())) <= SetDateYear(Max({1} TOTAL Date), Year(Today()))"},

Year, MonthName

3 Replies
agigliotti
MVP
MVP

what about your expected result on the frontend ?

where are you using that expression ?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
mariamovasheli
Contributor III
Contributor III
Author

Sum({<AccountTypeName = {'Expense'},Division = {'Hydro Division'},

Date = {"=SetDateYear(Only({1} Date), Year(Today())) <= SetDateYear(Max({1} TOTAL Date), Year(Today()))"},

Year, MonthName>} Amount)

This is the expression I use on bar chart And I use year as dimensions. But I don't want to look at it as max date but as max month. in other charts  I created Year={'$(=max(Year))'}, %ym={"<=$(=(Year(Max(Date)))*100+ month(Max(Date)) )"} this as current period and

Year={'$(=max(Year)-1)'}, %ym={"<=$(=(Year(Max(Date))-1)*100+ month(Max(Date)) )"}

as Previos year and I have differences beacise there is yearmonth without date and in firs expresion there is max date

so I want to see it in month angle if it is possible to have same data and also We only consider month as a period.

sunny_talwar
MVP
MVP

Try this

Date = {"=MonthStart(SetDateYear(Only({1} Date), Year(Today()))) = MonthStart(SetDateYear(Max({1} TOTAL Date), Year(Today())))"},