9 Replies Latest reply: Oct 1, 2018 9:01 AM by omar bensalem

# target

Hi Team,

Please refer to my source and sample app and provide me the solution.

• ###### Re: Month and rolling

Do u have a date field?

• ###### Re: Month and rolling

If u do not have a date field :

create a variable :

call it : vMaxMonth

as follow:

=date(max(date(Date#( MonthStart( date#(Month,'MMM')) ,'M/D/YYYY'),'DD/MM')),'DD/MM')

1)

Then, change ur measure from:

sum(Sales) to

Sum({<Month={"=date(Date#(MonthStart(date#(Month,'MMM')),'M/D/YYYY'),'DD/MM')='\$(vMaxMonth)'"}>}Sales)

Result:

• ###### Re: Month and rolling

and btwn, things will be SO MUCH EASIER if u have a date field

• ###### Re: Month and rolling

Thanks and can you please suggest me on the second chart - line chart to get the data till the values we select i.e if we select feb -- data should be Jan, Feb should appear.

• ###### Re: Month and rolling

U know what, Create a date field in ur script:

date( (date(Date#( MonthStart( date#(Month,'MMM')) ,'D/M/YYYY'),'DD/MM')&'/'&Year),'DD/MM/YYYY')  as Date,

Now expressions would be SO MUCJ EASIER:

1) Sum({<Date={"\$(=max(Date))"}>}Sales)

2) Sum({<Month, Date={"<=\$(=max(Date))"}>}Sales)

• ###### Re: Month and rolling

Thanks but I have month values in capital and may i know where to use that capitalize function

• ###### Re: Month and rolling

I can't follow u? Didn't I respond to ur quest? What capitalize function?

• ###### Re: Month and rolling

Have u tried the solution and remarked that it did not work?

FYI: Lower('JAN') => jan

Capitiliez('JAN') => Jan