Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Tags (2)
4 Replies
MVP
MVP

Re: Jan 1 Always Week 1

Hello,

Have you tried week function?

Thanks.

sushil353
Honored Contributor II

Re: Jan 1 Always Week 1

Hi,

try this:

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

HTH

Sushil

Not applicable

Re: Jan 1 Always Week 1

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

MVP
MVP

Re: Jan 1 Always Week 1

Hi,

Try LunarWeekName()

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

Hope it helps you.

Regards,

Jagan.

Community Browser