Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
Showing results for 
Search instead for 
Did you mean: 

Take the sum between two Dates

I have dataset which contains OrderDate wise Sales. Requirement is to show sum of sales from OrderDate to last 30 Days. I tried mutiple solutions provided on Portal but no luck. 

I tried expression like:

sum({<StartDate= {"<=$(=min(OrderDate))>=$(=max(DaysBack30))"}> } [Monthly Sales In Volume])

using variables:

SUM({$<StartDate = {">= '$(vStart)'<='$(vEnd)'}>} [Monthly Sales In Volume])

I tried by creating variables 

Sample datset is given below:

Sales is OrderDate wise sales. If user clicks on 01/01/2018 then sales should be displayed between 01/01/2018 to 01/12/2017 for that particular product.

OrderDate      ProductID    DaysBack30    Sales

01/01/2018   10000018   01/12/2017              550

01/01/2018   10000017   01/12/2017              350

12/01/2018   10000018   12/12/2017              2000

13/01/2018   10000019   13/12/2017              550

1 Reply

Re: Take the sum between two Dates

Depending on how your date is defined, you might need to add Date() format statements:

Sum({<StartDate= {"<=$(=Date(Min(OrderDate))) >=$(=Date(Max(DaysBack30)))"}>} [Monthly Sales In Volume])

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein