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

Get last week sales only

Hi friends,

I trying to retrieve sales only for last week or -7 days from today. I have a straight table with desired data in it, but I am using multi box filter from master calendar year, month and week. But I don’t want to use filters.  How can I get this? there is order date field available. 

Thanks in advance.

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

10 Replies
aarkay29
Specialist
Specialist

Something like this

sum({<OrderDate={">=$(=Date(today()-7,'MM/DD/YYYY'))<=$(=Date(today(),'MM/DD/YYYY'))"}>}Sales)


Change the Date format 'MM/DD/YYYY' to whatever format you have in OrderDate

madhuqliklondon
Creator II
Creator II
Author

Hi ,

Shall I use this in same straight table and add expression under expression tab?? I am trying to restrict to -7 days so I can schedule this report in nprinting. I do not want to sum or count .

aarkay29
Specialist
Specialist

Yes use the expression under expression tab with correct field names in your straight table

madhuqliklondon
Creator II
Creator II
Author

Hi, I have attached my qvw.

aarkay29
Specialist
Specialist

PFA

Thanks,

AAR

madhuqliklondon
Creator II
Creator II
Author

Nice, if i have to use all measures year, month ,week  ex: week(Order_date)=week(today()-7) is that possible because i have to use master calendar so...

aarkay29
Specialist
Specialist

I am sorry i am little confused here

are you saying that you want to change the max dates basing on the user selections and make them work accordingly ??

Or you want to show last week data basing on the week numbers instead of last 7 days

madhuqliklondon
Creator II
Creator II
Author

I have tried that set analysis in my dash board table , but is not changing anything. I was thinking may be it should apply individually on week, month and year? I don't know the reason why it's not changing my table ,I was expecting it should give me same result as if i use calendar filters right ??

aarkay29
Specialist
Specialist

Hey Madhu I am totally lost here

Can you please explain with the numbers to understand better and give you a solution.

Sorry about that, i am not clear what you exactly need here