Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

create fiscal week

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?

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Ceil(DayNumberOfYear(DateFieldName, 4)/7)


Regards,

jagan.

View solution in original post

10 Replies
arulsettu
Master III
Master III
Author

i already saw that. it dont have fiscal week

vardhancse
Specialist III
Specialist III

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,

jagan
Luminary Alumni
Luminary Alumni

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.

arulsettu
Master III
Master III
Author

hi

i am getting following result

Capture.JPG.jpg

thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Ceil(DayNumberOfYear(DateFieldName, 4)/7)


Regards,

jagan.

arulsettu
Master III
Master III
Author

hi

i changed already. one doubt how its different from ordinary calendar week can you explain?

Thanks

jagan
Luminary Alumni
Luminary Alumni

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.