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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Jan 1 Always Week 1

can you give me a script on how to set

Jan 1 is always Week 1 every Year

thank you

4 Replies
tresesco
MVP
MVP

Hello,

Have you tried week function?

Thanks.

sushil353
Master II
Master II

Hi,

try this:

get the month start date from monthstart() and then subtract 7 days from that.

HTH

Sushil

Not applicable
Author

you can use

Div(date-YearStart(date)+WeekDay(YearStart(date))+7,7) as WeekNumber

This will always return week 1 for Jan 1st. It will use Monday as the first day of the week.

If you want Sunday as the first day of the week, you should use

   Div(date-YearStart(date) + WeekDay(YearStart(date)+1) +7,7) as WeekNumber

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try LunarWeekName()

=Right(LunarWeekName(MakeDate(2012, 1)), 2)

Hope it helps you.

Regards,

Jagan.