Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
david_ze
Partner - Contributor III
Partner - Contributor III

Showing YearMonth trend

Hi all,

I would like your help on how to show a YearMonth trend...

I have a field 'YearMonth' (shown like '201303', '201302'....)  and an expression sum(Total_Sales), I would like to let the ability to

show a trend chart for the last 12 months when the user chooses YearMonth.

For example, I the user chooses 201303 than the chart should show the numbers starting from 201204...to 201303.

I'll appreciate your advice on this.

Best regards,

David

1 Solution

Accepted Solutions
er_mohit
Master II
Master II

sum({<YearMonth={">$(=Date(Addmonths(Max(YearMonth),-12),'YYYYMM'))<=$(=DAte(Addmonth(Max(YearMonth),0),'YYYYMM'))"}>}Sales)

View solution in original post

3 Replies
er_mohit
Master II
Master II

sum({<YearMonth={">$(=Date(Addmonths(Max(YearMonth),-12),'YYYYMM'))<=$(=DAte(Addmonth(Max(YearMonth),0),'YYYYMM'))"}>}Sales)

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Do you have datefield in number format?

if so you can use like

Sum({<YearMonth=,DateFieldNum={">=Floor(MonthStart(Max(DateFieldNum), -11))<=Floor(MonthEnd(Max(DateFieldNum)))"}>} Sales)

if you Year and Month fields exclude that also.

david_ze
Partner - Contributor III
Partner - Contributor III
Author

Thanks...works ok.