Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calendar Weeks

Hello,

I have a calendar that shows me Week numbers, is it possible instead of Week Number to show the actual days?

For example, current week is 43, I would like to show Oct 20-26, 2014 instead and when the week overlaps another month like week 44, then I would like to show Oct 27-Nov 01, 2014. How can I achieve this on my calendar?

Thank you,

Hugo

1 Solution

Accepted Solutions
MarcoWedel

forgot the year ...

QlikCommunity_Thread_139268_Pic2.JPG.jpg

tabCalendar:

LOAD *,

    Week(Date) as Week,

    WeekName(Date) as WeekName,

    Dual(Date(WeekStart(Date),'MMM DD')&'-'&Date(WeekEnd(Date),If(Month(WeekStart(Date))= Month(WeekEnd(Date)),'DD','MMM DD'))&', '&WeekYear(Date),WeekStart(Date)) as WeekStartEnd,

    WeekYear(Date) as WeekYear;

LOAD Date(YearStart(Today())+IterNo()-1) as Date

AutoGenerate 1

While IterNo() <= DayNumberOfYear(Today());

hope this helps

regards

Marco

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Belcils,

You  can try it!

WeekStart(Date)

  output 20/10/2014

WeekEnd(Date)

  output 26/10/2014

You  can select  week 43

WeekStart(Date) &'-'& WeekEnd(Date)

You  can select  week 43

20/10/2014 - 26/10/2014

MarcoWedel

Hi,

one solution could be:

QlikCommunity_Thread_139268_Pic1.JPG.jpg

tabCalendar:

LOAD *,

    Week(Date) as Week,

    WeekName(Date) as WeekName,

    Dual(Date(WeekStart(Date),'MMM DD')&'-'&Date(WeekEnd(Date),If(Month(WeekStart(Date))= Month(WeekEnd(Date)),'DD','MMM DD')),WeekStart(Date)) as WeekStartEnd,

    WeekYear(Date) as WeekYear;

LOAD Date(YearStart(Today())+IterNo()-1) as Date

AutoGenerate 1

While IterNo() <= DayNumberOfYear(Today());

hope this helps

regards

Marco

MarcoWedel

forgot the year ...

QlikCommunity_Thread_139268_Pic2.JPG.jpg

tabCalendar:

LOAD *,

    Week(Date) as Week,

    WeekName(Date) as WeekName,

    Dual(Date(WeekStart(Date),'MMM DD')&'-'&Date(WeekEnd(Date),If(Month(WeekStart(Date))= Month(WeekEnd(Date)),'DD','MMM DD'))&', '&WeekYear(Date),WeekStart(Date)) as WeekStartEnd,

    WeekYear(Date) as WeekYear;

LOAD Date(YearStart(Today())+IterNo()-1) as Date

AutoGenerate 1

While IterNo() <= DayNumberOfYear(Today());

hope this helps

regards

Marco

Not applicable
Author

Thank you very much for your responses, Marco your solution works 100% and it solves my issue. Thank you very much for your help.

MarcoWedel

You're welcome.

Regards

Marco

MarcoWedel

Hi,

to correct different years for week start and week end between december and january, another solution could be:

QlikCommunity_Thread_139268_Pic3.JPG.jpg

tabCalendar:

LOAD *,

    Week(Date) as Week,

    WeekName(Date) as WeekName,

    Dual(Date(WeekStart(Date),'MMM DD'&If(Year(WeekStart(Date))<>Year(WeekEnd(Date)),', YYYY'))&'-'&

          Date(WeekEnd(Date),If(Month(WeekStart(Date))<>Month(WeekEnd(Date)),'MMM ')&'DD, YYYY'),

          WeekStart(Date)) as WeekStartEnd,

    WeekYear(Date) as WeekYear;

LOAD Date(AddYears(YearStart(Today()),-5)+IterNo()-1) as Date

AutoGenerate 1

While AddYears(YearStart(Today()),-5)+IterNo()-1 <= Today();

hope this helps also

regards

Marco