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

Moving average per date (period +/- 3 day) without date in dimension

Hello!

I'm trying to calculate the average daily sales (including +/- 3 days)

In Excel it looks like this:

    

DimDateIDSalesAvgSales-+3
Dim101.10.201834,50
Dim102.10.201844,20
Dim103.10.201853,83
Dim104.10.201863,86
Dim105.10.201834,14
Dim106.10.201823,86
Dim107.10.201843,71
Dim108.10.201853,71
Dim109.10.201823,71
Dim110.10.201843,71
Dim111.10.201863,71
Dim112.10.201833,71
Dim113.10.201824,00
Dim114.10.201844,00
Dim115.10.201853,50

For example: AvgSales-+3 for 7.10.2018 = average sales from 4.10.2018 till 10.10.2018

In qlik i'm calculated this by expression:

RangeAvg(

  Above(Sum(Aggr(Sum(Sales),DateID)),0,4),

  Below(Sum(Aggr(Sum(Sales),DateID)),1,3)

)

Help me  please calculate this sum of average values without a date in the dimension?

2 Replies
sunny_talwar

If date is not a dimension... then is this based on a selection?

Anonymous
Not applicable
Author

I need to get the amount of some average for the period.

I'm trying to calculate lost sales.