Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a calendar month, so how can i convert to fisical year. For example like fisical year starts at 2017/May
Take a look here: Fiscal Year.
- Marcus
Hello Arun,
Use following Code in your backend Script
Temp:
Load
Date(min(CalenderMonth),MM/YYYY) as minDate,
Date(max(CalenderMonth),MM/YYYY) as maxDate
Resident SalesData;
Let varMinDate = Num(Peek('minDate', 0, 'Temp'));
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));
DROP Table Temp;
TempCalendar:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
Load
*,
AutoNumber(Period, 'PeriodID') as [PeriodID];
MasterCalendar:
Load*,
Num(Month) as MonthNum;
load*,
Dual(Month,[Fiscal Month num]) as FiscalMonthName;
Load
Year(TempDate) * 100 + Month(TempDate) as [Period],
TempDate AS CalenderMonth,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month ,
if(Month(TempDate)<=4,Month(TempDate)+(12-4),month(TempDate)-4) AS [Fiscal Month num],
if(Month(TempDate)<=4,year(TempDate)+1,year(TempDate)) as [Fiscal year]
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
Regads
Vikas
Convert this field to date field as
date(date#(CalendarMonth,'YYYYMM')) as CalendarDate,
For Fiscal Year,
Yearname(date(date#(CalendarMonth,'YYYYMM')),5) as FiscalYear