Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Currently the table displays data from jan to current month (see fig below)
Is it possible to display data from current month to previous 12 months
May | jun | July | Aug | Sep | Oct | Nov | Dec | Jan | Feb | Mar | April | |
52,850 | 47,806 | 52,822 | 51,114 | 52,818 | 51,114 | 52,818 | 52,818 | 51,114 | 52,818 | 51,114 | 52,818 |
Any suggestions?
B
Try a creating a flag based on your date field or you could also create a seperate column in the script editor for rolling months
something like this:
IF
(Your_DATE<=date(monthstart(today()),'YYYY-MM-DD') AND Your_DATE >= date(addmonths(monthend(date(today(),'MMM-YYYY')),-12) ,'YYYY-MM-DD'),1,NULL()) as Rolling_flag,
IF(Your_DATE<=date(monthstart(today()),'YYYY-MM-DD') AND Your_DATE>= date(addmonths(monthend(date(today(),'MMM-YYYY')),-12) ,'YYYY-MM-DD'),Your_DATE,NULL())AS ROLLING_DATE,
Hope this helps
SM
Yes yo can make it rolling months refer the below URL for rolling months
Calculating rolling n-period totals, averages or other aggregations
Anand,
I did go through the post, I don't know if it would solve my problem.
I was wondering should I use a variable that holds current month ..then display previous months.
What would be the besgt way to implement the solution, using set analysis or in the script editor
B
Is it possible to load only the previous 12 months ?
In the script level you can do like this
Create two variables which is based on the Monthyear because you want rolling 12 months
vPrevMonthYear = Num(AddMonths(MonthYear,-12)) ;
vCurrMonthYear = Num(MonthYear) ;
Then use in script like
Dimension :- Monthyear
I believe it is a sales value you change according to you
Expression :- =Sum({$<MonthYear = {">$(vPrevMonthYear) <=$(vCurrMonthYear)"}>} Sales)
Regards
Is rolling back 12 months problem solve if so then mark the thread as Correct or helpful.
Sorry for the late reply,
Do i generate a calendar between the vPrevMonthYear and vCurrMonthYear ?
Try a creating a flag based on your date field or you could also create a seperate column in the script editor for rolling months
something like this:
IF
(Your_DATE<=date(monthstart(today()),'YYYY-MM-DD') AND Your_DATE >= date(addmonths(monthend(date(today(),'MMM-YYYY')),-12) ,'YYYY-MM-DD'),1,NULL()) as Rolling_flag,
IF(Your_DATE<=date(monthstart(today()),'YYYY-MM-DD') AND Your_DATE>= date(addmonths(monthend(date(today(),'MMM-YYYY')),-12) ,'YYYY-MM-DD'),Your_DATE,NULL())AS ROLLING_DATE,
Hope this helps
SM