# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Highlighted
Contributor

## Rolling average, 3 period average

I need to create the figures in the bottom table as KPIs - just struggling with the expression for the 3 batch average - it works in my main table but I can't get it to work alone

Can anybody help with this?

Thanks

 DATE IN Avg(DLWG1) Avg(aggr(rangeavg(above(Total Avg({<[DATE IN]=>}DLWG1),0,3)),[DATE IN])) 20/12/2018 1.02 1.02646717 10/01/2019 1.06 1.033968929 24/01/2019 1.13 1.070667567 07/02/2019 1.25 1.146228954 21/02/2019 1.27 1.216261005

 Latest Batch 3 Batch Avg 1.27 1.22
Labels (3)

• ### rangeavg

1 Solution

Accepted Solutions

## Re: Rolling average, 3 period average

Perhaps this?

1. Max({<[DATE IN] = {"\$(=Max([DATE IN]))"}>} Aggr(Avg(DLWG1), [DATE IN]))

2. Avg({<[DATE IN] = {"\$(=Max([DATE IN]))"}>} aggr(rangeavg(above(Total Avg({<[DATE IN]=>}DLWG1),0,3)),[DATE IN]))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
3 Replies

## Re: Rolling average, 3 period average

Perhaps this?

1. Max({<[DATE IN] = {"\$(=Max([DATE IN]))"}>} Aggr(Avg(DLWG1), [DATE IN]))

2. Avg({<[DATE IN] = {"\$(=Max([DATE IN]))"}>} aggr(rangeavg(above(Total Avg({<[DATE IN]=>}DLWG1),0,3)),[DATE IN]))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Contributor

## Re: Rolling average, 3 period average

Number 2 works great!

Thankyou

## Re: Rolling average, 3 period average

Glad you like my second expression, But can you simplify as this for first one?

Avg({<[DATE IN] = {"\$(=Max([DATE IN]))"}>} DLWG1)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)