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: 
Not applicable

First week of the Financial Year

Hi All,

I am trying to split Year, Quarter, Month, Week and Day from my Date column

I am incorporating Indian Financial Calender 2014-15 i.e First Month is April 14 and last Month is March 15

I need your assistance to get the first week of the Financial Year i.e. the first week of Apri l14 should be the first week of the year, I am using Weekname function but am unable to get the result

Attached is the Data and QVW.

Thanks in advance.

5 Replies
whiteline
Master II
Master II

Hi.

According to QV help:

"If you want to work with weeks not starting midnight between Sunday and Monday,

indicate an offset in days in weekoffset."

So, you have to calculate the offset in days:

WeekName([Appointment_Date],0, DayNumberOfYear(makedate(year([Appointment_Date]), 4, 1)))

Gysbert_Wassenaar

See attached qvw for a calendar creation script that also generates the week numbers.


talk is cheap, supply exceeds demand
antoniotiman
Master III
Master III

It depends on the query on your DB.

For example in MySql :

Week(Data,3)   means the first week of the year is 1 and the first day of week is Monday.

The Default as Week(Data) is the first weeh of day 1 and the first day of week Sunday.

Regards,

Antonio

Not applicable
Author

Hi White Line,

Your code worked, however for the first week of the Year i.e 1st week of April 2014 the days getting highlighted are from 1st Apr 2014 to 07th Apr 2014.

Actually the 1st week of the year 2014, should start from 30th March 2014(Sunday) and end at 05th April 2014 (Saturday)

whiteline
Master II
Master II

WeekName([Appointment_Date],0, DayNumberOfYear(makedate(year([Appointment_Date]), 3, 30)))

There is no magic. Read the QV help.