Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
i am having date field like this 20140608. and having fiscal year field values like 2014 and fiscal month values like 12. now i need fiscal week. how to create it any help?
Hi,
Try like this
Ceil(DayNumberOfYear(DateFieldName, 4)/7)
Regards,
jagan.
i already saw that. it dont have fiscal week
Fiscal week/year we need to define in our calendar.
because it varies from one organization to another organization.
Eg: for calendar week and fiscal week, we can make
'WK'&'-'&Div(TempDate-YearStart(TempDate)+WeekDay(YearStart(TempDate)+1)+7,7)
as Calendar_Week,
'FWK'&'-'&Div((TempDate+'61')-YearStart((TempDate+'61'))+WeekDay(YearStart((TempDate+'61'))+3)+7,7)
as Fiscal_Week,
Hi,
Try like this
DayNumberOfYear(date[,firstmonth])
--firstmonth is the starting month of the year.
Ex:
LOAD
*,
Ceil(DayNumberOfYear(DateFieldName, 4]))/7 AS FiscalWeek -- Assuming April is the starting month of Fiscal year
FROM Datasource;
Regards,
Jagan.
hi
i am getting following result
thanks
Hi,
Try like this
Ceil(DayNumberOfYear(DateFieldName, 4)/7)
Regards,
jagan.
hi
i changed already. one doubt how its different from ordinary calendar week can you explain?
Thanks
Hi,
Normal calendar starts from Jan 1, for normal calendar DayNumberOfYear(DateFieldName) will give 1 for Jan 1, 2 for Jan 2, 3 for Jan 3 and so on.
For Fiscal (the second parameter FirstMonth) specifies the start date of a calendar, for example if you give then the start date of the year is 1 Apr. So DayNumberOfYear(DateFieldName) will give 1 for Apr 1, 2 for Apr 2, 3 for Apr 3 and so on.
We are dividing the result by 7 for DayNumberOfYear() to get the week number.
Hope this helps you.
Regards,
Jagan.