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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Getting Data for Past 4 Weeks

I am trying to get data for the past 4 weeks.  I have tried the following but am getting the errors in expression message:

=Sum({<Year=, Quarter=, Month=, Week=, Date={‘>=$(=WeekStart(Max(PAYMENT_POST_DATE), -4))<=$(=Date(Max(PAYMENT_POST_DATE)))’}>} REMIT_AMOUNT )

I have changed the SET DateFormat='YYYY-MM-DD' to match with PAYMENT_POST_DATE.

I found this at:

https://community.qlik.com/docs/DOC-9144?_ga=2.191541354.1333035801.1521571620-238648824.1512403417

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I got it to work with the following code:

=Sum({<PAYMENT_POST_DATE={">=$(=Weekstart(Max(PAYMENT_POST_DATE), -9))<=$(=Date(Max(PAYMENT_POST_DATE)))"}>} REMIT_AMOUNT)

View solution in original post

3 Replies
Anonymous
Not applicable
Author

I also tried the following but got the same errors in expression::

=Sum({<Year=, Quarter=, Month=, Week=, Date={‘>=$(=WeekStart(Today(), -14))<=$(=Today())’}>} Sales )

What should the format of the Today() be?  I currently have it as SET DateFormat='YYYY-MM-DD';

Anonymous
Not applicable
Author

I have a chart that needs to look back 10 weeks.

I get no data display for the following:

=Sum({=$(=WeekStart(Max(Date), -10))<=$(=WeekEnd(Max(Date)))'}>} Value)


Last 15 Weeks Sales
Sum({=$(=WeekStart(Max(Date), -10))<=$(=Date(Max(Date)))’}>} Sales )

Sum({=$(=WeekStart(Today(), -10))<=$(=Today())’}>} Sales )

Anonymous
Not applicable
Author

I got it to work with the following code:

=Sum({<PAYMENT_POST_DATE={">=$(=Weekstart(Max(PAYMENT_POST_DATE), -9))<=$(=Date(Max(PAYMENT_POST_DATE)))"}>} REMIT_AMOUNT)