Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

Problem with week to date expression

Hi all,

I have a trouble with the WeekToDate expression.

In fact, the values returned when I use the WTD are the same returned with the MTD..

As if the WeekStart function acts like the MonthStart function and returns the debut of each month.

Here are the expressions I used for each case:

WTD:

Sum({<Year=, Month=, Quarter=, [Date Ventes]= , DateNum={">=$(=Num(WeekStart(Max(DateNum))))<=$(=Max(DateNum))"}>} [Chiffre d'affaires])

WTD-1 :

Sum({<Year=, Month=, Quarter=, [Date Ventes]= , DateNum={">=$(=Num(WeekStart(Max(DateNum),-52)))<=$(=Num(addyears(max([Date Ventes]),-1)))"}>} [Chiffre d'affaires]

MTD :

Sum({<Year=, Month=, Quarter=, [Date Ventes]= , DateNum={">=$(=Num(MonthStart(Max(DateNum))))<=$(=Max(DateNum))"}>} [Chiffre d'affaires])

MTD-1 :

Sum({<Year=, Month=, Quarter=, [Date Ventes]= , DateNum={">=$(=Num(MonthStart(Max(DateNum),-12)))<=$(=Num(addyears(max([Date Ventes]),-1)))"}>} [Chiffre d'affaires])

I have yet another question: what's the purpose of "Year=, Month=, Quarter=, [Date Ventes]=" ? I know that if I delete them and then filter by dte, I won't have the same result. But why?

Thank you !

10 Replies
swuehl
MVP
MVP

1st and 2nd august 2015 were Sat / Sun.

These two dates are the difference between WTD and MTD

Do you have values to aggregate for weekends?