Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Ama1
Contributor
Contributor

Master Calender with Fiscal year

Hi, 

 

I want to create master calender with fiscal year that starts from Mar 1st .  

can any one please share the script

Labels (1)
1 Reply
sasikanth
Master
Master

Try

below script

 

Let vFM_NO=3;


Load
TempDate AS DATE_KEY,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day (TempDate) as Day,

Year(TempDate) + If(Month(TempDate)>=$(vFM_NO), 1, 0) as FinYear,
Mod(Month(TempDate)-$(vFM_NO), 12)+1 as FinMonth,
'Q'&ceil((Mod(Month(TempDate)-$(vFM_NO), 12)+1)/3) as FY_Qrter,

Dual((Year(TempDate) + If(Month(TempDate)>=$(vFM_NO), 1, 0))-1 &'-'& (Year(TempDate) + If(Month(TempDate)>=$(vFM_NO), 1, 0)),
(Year(TempDate) + If(Month(TempDate)>=$(vFM_NO), 1, 0))) as FY_Year,

dual(Month(TempDate),Mod(Month(TempDate)-$(vFM_NO), 12)+1) as FY_Month

resident Master_Calendar;