Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calendar week with dates from 2 different years

Hi i have lil problem. I have a chart that always shows all days of a month + days from the previous and following months when the the month start or end was in the middle of a week. for example the 01.03.2012 was a wedensday so i have in my chart also tuesday 28.02.2012 and monday 27.02.2012. ok my set analysis perfect for every month except january and december. I understand the problem but I dont know how to solve it.

ok the problem is:

01.01.2012 was a sunday so in my chart should show 31.12.2011 and so on... but the problem is that qv doesnt understand to take the previous year.

here is the formula:

only({<#Filiale_KBS = , #KW = {'>=$(=Week(MakeDate(#Jahr,#Monat,1)))<=$(=week(MonthEnd(MakeDate(#Jahr,#Monat,1))))'}, #Monat = , FILIALEN_OG.KURZNAME, #LagerNr = , Artikelgruppen.RESSORT= , [Artikelgruppen.U RESSORT] = >}#Datum)

oh and my chart has calendar week and weekday as dimension.

does anyone have an idea how to solve this problem for januaray and december???

regards,

MT

1 Solution

Accepted Solutions
Not applicable
Author

ok I found my mistake. I also had to ignore the year selection. Thanks i appriciate you help

View solution in original post

6 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Look at WeekStart() function.  I think this will break over years OK.

Hope this helps,

Jason

Not applicable
Author

Basicly you are right that weekstart jumps over the years but my problem now is that my chart wont show the date no more here is my formular maybe i did smth wrong (pretty sure i did) but i cant find the mistake.

Only({<#Datum = {'>=$(=WeekStart(MakeDate(#Jahr,#Monat,1)))<=$(=WeekEnd(MonthEnd(MakeDate(#Jahr,#Monat,1))))'}, #Monat = >}#Datum)

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Try keeping your expressions simple by pushing what you can back to the script. For example:

WeekStart(MakeDate(#Jahr,#Monat,1))     AS     WeekStart

Otherwise please post your app to make it easier to help.

Not applicable
Author

#Jahr is the selected year and #Monat the selected month i found my mistake but it is still not showing the days of the previous year

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Ah - OK.  If you post your app I maybe able to help further. Otherwise it's kind of guesswork.

Not applicable
Author

ok I found my mistake. I also had to ignore the year selection. Thanks i appriciate you help