Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rolling Average in Column Chart

Hello,

I am trying to calculate a rolling average line where the 'average' for a month = (current month + previous month) / 2.

This is depicted by the 'average' row in the screenshot below.

For all intents and purposes, we will say that my expression is Sum(Sales).

Thank you.

Average.PNG

1 Solution

Accepted Solutions
mayuresh_d
Partner - Creator
Partner - Creator

hi,

it will be better if you bring previous month sales against current month sales in script.

for that take resident of original table then in month field take it as (month-1)

and with help of key and month field join it to original table this will saves calculations on front end might increase front end calculation performance.

thanks

Mayuresh

View solution in original post

7 Replies
sunny_talwar

May be this

RangeAvg(Before(Sum(Sales), 0, 2))

dan_sullivan
Creator II
Creator II

try something like this:

RangeSum(Sum(Sales),Above(Sum(Sales)))  / 2

Anonymous
Not applicable
Author

Close, but not quite

sunny_talwar

What is missing?

mayuresh_d
Partner - Creator
Partner - Creator

hi,

it will be better if you bring previous month sales against current month sales in script.

for that take resident of original table then in month field take it as (month-1)

and with help of key and month field join it to original table this will saves calculations on front end might increase front end calculation performance.

thanks

Mayuresh

Anonymous
Not applicable
Author

Yes, this will work - thank you.

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post; not visible in preview) and Helpful Answers (found under the Actions menu under every post).

If not, please make clear what part of this topic you still need help with .

May you live in interesting times!