Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
shamitshah
Partner - Creator
Partner - Creator

Range Average

Hi,

I have the following expression to calculate the 3 day average but getting incorrect results for certain dates:

sum( aggr( RangeAvg(above( sum(Stock1),0,3) ),RecordDate))

The average for 3 Dec 2015 should be (5+7+7)/3 = 6.33

The raw data has missing dates, and I have generated those dates to be included in the above table.

Missing dates were 3,4,6,8,9,11 &12

Not sure whether that would be the cause.

Any ideas?

Thanks

Shamit

1 Solution

Accepted Solutions
Kushal_Chawda

try this

RangeAvg(above(total  sum(Stock1),0,3) )

View solution in original post

7 Replies
sunny_talwar

Can you check what you get for this:

RangeSum(above( sum(Stock1),0,3))

Kushal_Chawda

try this

RangeAvg(above(total  sum(Stock1),0,3) )

shamitshah
Partner - Creator
Partner - Creator
Author

Hi Sunny,

That's give the running 3 day total.

Regards

Shamit

shamitshah
Partner - Creator
Partner - Creator
Author

Hi Kushal,

That's gives the correct answer.

Thanks

Shamit

sunny_talwar

Ya that what I wanted to check that if you were getting the totals to be correct or not. But I guess adding the TOTAL did the job for you

Kushal_Chawda

That's gr8

Kushal_Chawda

Total solves many set analysis issues also stalwar1