# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor II

## 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.

1 Solution

Accepted Solutions
Highlighted
Contributor

## Re: Rolling Average in Column Chart

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

7 Replies
MVP

## Re: Rolling Average in Column Chart

May be this

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

Contributor II

## Re: Rolling Average in Column Chart

try something like this:

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

New Contributor II

## Re: Rolling Average in Column Chart

Close, but not quite

MVP

What is missing?

Highlighted
Contributor

## Re: Rolling Average in Column Chart

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

New Contributor II

## Re: Rolling Average in Column Chart

Yes, this will work - thank you.

Honored Contributor III