Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

set analysis 3 day avg

Hi all

i have a table that looks like this dates and number of sales

DateSale
23/12/20132
22/12/20135
21/12/20135
20/12/20135
19/12/20136
18/12/20131
17/12/20132
16/12/20133

i need to show a graph for each day the avg  sale amount  of the 3 prev days

for example on the 23/12/13 the Avg3DaySale will be (5+5+5)/3

22/12/13 the Avg3DaySale  will be (5+5+6)/3

DateSaleAvg_3DaySale
23/12/201325
22/12/201355.333333
21/12/201354
20/12/201353
19/12/201362
18/12/201312.5
17/12/201323
16/12/20133#DIV/0!

my big limitation is that i cant do this in the script i have to do this with a set analysis  in the gui

any ideas?

7 Replies
giakoum
Partner - Master II
Partner - Master II

You can use the above function. But if today is Monday, should it average Thu, Fri and Mon?

giakoum
Partner - Master II
Partner - Master II

This is a better solution. See attached

maxgro
MVP
MVP

do you mean a similar expression?

RangeAvg( above( sum(Sale),0,3) )

giakoum
Partner - Master II
Partner - Master II

yes correct

Anonymous
Not applicable
Author

it doesn't work if i have 2 dimensions

Anonymous
Not applicable
Author

like if i have something like this

the 2 day sum col will sum up by date and category

Rangesum( above( sum(Sales),0,2) )

Datecategorysales2 day sum
26/12/13shoe0.000.00
27/12/13shoe3.003.00
28/12/13shoe1.004.00
29/12/13shoe1.002.00
30/12/13shoe1.002.00
31/12/13shoe13.0014.00
01/01/14shoe7.0020.00
26/12/13dress3.00

3.00

here is where i have a problem

27/12/13dress0.003.00
28/12/13dress0.000.00
29/12/13dress2.002.00
30/12/13dress1.003.00
31/12/13dress6.007.00
01/01/14dress7.0013.00
Not applicable
Author

Hi Jonathan,

Check this link you will get clear idea about rangesum and rangeavg .

Rangesum Above ,Below and Before,After and Range Avg

regards

Mahesh T