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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
stevietm
Creator
Creator

Week of month

HI people

I need week of month expretion...Im still very new at Qlikview and realy need help...

Thanx for any help u can offer...

Labels (1)
1 Solution

Accepted Solutions
johnw
Champion III
Champion III

There are a lot of very different things that "week of month" can mean. There are therefore a lot of possible answers. Here are a couple more possibilities from a working example application:

,1+ceil((Date-floor(weekend(monthstart(Date),0,-1)))/7) as "US Week but Start and End in Month"
,1+ceil((Date-floor(weekend(monthstart(Date))))/7) as "ISO Week but Start and End in Month"

View solution in original post

5 Replies
spividori
Specialist
Specialist

Hi.

Try In the script load:

week(Date) as nWeek

Regards.

Not applicable

Hi,

You could also try Day(Today()-1)/7 + 1

Just replace Today() with the date from which you want the week

Regards.

Not applicable

Just write in the script

If day(Date)<8, W1, IF(Day(Date)<15, W2, IF(Day(Date)<22, W3, W4 ))) as WeekofMonth

Just check the parentheses!

johnw
Champion III
Champion III

There are a lot of very different things that "week of month" can mean. There are therefore a lot of possible answers. Here are a couple more possibilities from a working example application:

,1+ceil((Date-floor(weekend(monthstart(Date),0,-1)))/7) as "US Week but Start and End in Month"
,1+ceil((Date-floor(weekend(monthstart(Date))))/7) as "ISO Week but Start and End in Month"

Not applicable

Depende mucho de cómo lo necesites.