Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
khadar
Contributor III
Contributor III

How to get week number in months

Hi Experts,

I need small help on how to get week numbers from the respective months. I used the WEEK qlik function to get the week from the month (week(Date_Field)) I got the week number for year like 43,44. I really do not want in this way.

I want in this way if I selected for example OCT-2022 month, it should show 1,2, 3,4 weeks of the oct-2022 and week should start from Monday and end with Sunday,

can any one help on this pls?

 

Labels (1)
1 Reply
Vegar
MVP
MVP

I find it a bit troublesome to work with weeks in combination with months as there is no clean relationships between the two. A month can start on any weekday and stretch over a different amount of weeks.

To solve this you could try to use the difference between the week of your date and the week of the start of the month. Like this:

week(DateField)-week(monthstart(DateField))+1