Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
StacyCui
Creator

Rolling Month Calendar(Fiscal Month)

Recently, I want to create a fiscal rolling month calendar for PY and CY.

like the below screenshot. I have written the fiscal month calendar. How to write the rolling month calendar . It's too difficult. Could you help me out? Thank you so much.

StacyCui_1-1670070574235.png

let vMinDate=num(Date('2021-10-01'));
let vMaxDate=num(Date('2023-09-30'));

Master_Calendar_Temp:
LOAD
Date(TempDate) as "FROZENDATE",
if(YearToDate(TempDate,0, 10) or YearToDate(date(num(TempDate)+1),-1, 10),'YTD') as FYTD,
'P'&Month(AddMonths (Date(TempDate,'MM/dd/yyyy'),3))*1 as Fmonth,
if (date(TempDate)>='10/1/2022', 'CY','PY') as FY;
LOAD
$(vMinDate) + IterNo() - 1 as TempDate
Autogenerate 1 While ($(vMinDate) + IterNo() - 1) <= $(vMaxDate);


CrossTable(Flag, Month)
LOAD FROZENDATE, FYTD, Fmonth Resident Master_Calendar_Temp;


DROP Field Flag;

1 Reply
Aditya_Chitale
Specialist

Can you explain the exact login behind your output ? it is difficult to understand using only screenshot.

Regards,

Aditya