Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I've been strugling to create a script/measure to calculate sales for the the last 7 days from upload date.
Example:
Let's assume these are the most recent records available:
Sale Date: 01/11/2014 Sales amount: $50
02/11/2014 $55
03/11/2014 $45
04/11/2014 $45
05/11/2014 $60
06/11/2014 $40
07/11/2014 $55
Data uploaded in Qlik on 08/11/2014 (daily load).
I'd like to see sales amount for each day on the chart. It would be great if I could use date filter too, so if I choose a different date it would show sales amount by day for the last 7 days from selected day.
Hope that makes sense. All ideas and suggestions are welcome.
Many thanks,
Linas
Create a chart
Dimension
Date
Expression
SUM({<Date = {">=$(Date(Today()-6))<=$(Date(Today()))"}>}Amount)
or
SUM({<Date = {">=$(Date(Max(Date)-6))<=$(Date(Max(Date)))"}>}Amount)
Create a chart
Dimension
Date
Expression
SUM({<Date = {">=$(Date(Today()-6))<=$(Date(Today()))"}>}Amount)
or
SUM({<Date = {">=$(Date(Max(Date)-6))<=$(Date(Max(Date)))"}>}Amount)
Perhaps this document helps: Calculating rolling n-period totals, averages or other aggregations
Manish,
Your answer was very close, this is what worked for us:
SUM({<Date={">=$(=date(Max(Date)-7))<=$(=date(Max(Date)-1))"},Date= >} Amount)
Thanks,
Linas