Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
purna
Contributor III
Contributor III

last 7 days sales

9/12/2021 Office Supplies 18.504
10/12/2021 Office Supplies 114.9
11/12/2021 Furniture 1706.18
12/12/2021 Technology 911.424
13/12/2021 Office Supplies 15.552
14/12/2021 Office Supplies 407.976
15/12/2021 Office Supplies 68.81
     
Last Sevan Days total   3243.35

 

Given expression in frontend is : sum({$<[Order Date]={">=12/8/2021<=12/15/2021"}>}Sales)

                                                                                                       (or)

Sum( {$ <[Order Date] = {">=$(= Date(Max([Order Date])-7))<=$(= Date(Max([Order Date])))"}>} Sales)

But getting the wrong result  2734.27

 

Please let me know where is the wrong in the script or in data.

And also please let me know how to calculate the same for 60days also

1 Reply
randomuser
Partner - Contributor
Partner - Contributor

Hi, 
First, the date in your is represented in format DD-MM-YYYY. You can change default format of data in your main load script. Just like that :

randomuser_0-1637243723731.png

What's more you can change a little your expression like that:  

sum(if([Order Date]>=Date(Today()-7),Sales))

If you want to make your calculation for 60days type 60 instead of 7.

Regards