Skip to main content
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
Partner - Champion
Partner - Champion

what about your expected result on the frontend ?

where are you using that expression ?

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

Try this

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