Fiscal Calendar with Non-Standard Days (Not 1-31)

    Hi All,

    Hope the below script helps for those who are looking for a Fiscal Calendar for non standard dates.  For example the month starts from 26 th of previous month to 25th of current month.

     

    Jan-2015: 26-Dec-2014 to 25-Jan-2015

    Feb-2015: 26-Jan-2015 to 25-Feb-2015

    Mar-2015: 26-Feb-2015 to 25-Mar-2015

    '

    '

    '

    '

    '

    For this type of Fiscal Calendar you may use below script.

     

    LET vStartDate = MakeDate(2015, 1, 1);
    LET vEndDate = MakeDate(2016, 12, 31);
    LET vNumberOfDays = vEndDate - vStartDate + 1;
    
    FiscalCalendar:
    LOAD
    *,
    Month(FiscalDate) AS Month,
    Year(FiscalDate) AS Year,
    'Q' & Ceil(Month(FiscalDate)/3) AS Quarter,
    MonthName(FiscalDate) AS MonthYear,
    'Q' & Ceil(Month(FiscalDate)/3) & '-' & Year(FiscalDate) AS QuarterYear;
    LOAD Date,
    Date(monthstart(Date-25,1)) as FiscalDate,
    Day(Date(Date-25)) AS DayNumberInMonth;
    LOAD
    Date(makedate(2015)+recno()-1) as Date
    AutoGenerate $(vNumberOfDays);
    

     

    Regards,

    Jagan.