8 Replies Latest reply: Apr 26, 2013 10:13 AM by jagan mohan rao appala

# Calculated Average from Average

Hi,

In the below formula I don't know what I am doing wrong.

=Avg(Avg(D2-D1) + Avg(D3-D2) + Avg(D4-D3))

I am using this formula in a expression for a speedometer chart to calculate the average no of days between D1 to D4.

Your help is very much appreciated.

Thanks!!

• ###### Re: Calculated Average from Average

QlikView does not accept average to average

• ###### Re: Calculated Average from Average

Then how can I achieve it? May be percentage would be good idea?

• ###### Re: Calculated Average from Average

As these dates are formatted?

Could you post an example?

• ###### Re: Calculated Average from Average

Hello Pacheco,

I attched the qvw file above. I am usign the speedometer chart.

• ###### Re: Calculated Average from Average

You can wrap it inside an aggregation as well, to do an avg(aggr(avg(D1to3),Dimensions))

Your dimensions for the aggr should be anything the user can select based on.

Edited for clarity using your expression:

Avg(Aggr(Avg(D2-D1) + Avg(D3-D2) + Avg(D4-D3)), Dimensions)

• ###### Re: Calculated Average from Average

I tried this way also Anders, but for the example that qvw SAARU sent did not work.

• ###### Re: Calculated Average from Average

Hi,

Hi,

Try using RangeAve

=RangeAvg(Avg(D2-D1),  Avg(D3-D2),  Avg(D4-D3))

Hope this helps you.

Regards,

Jagan.