Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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!!

8 Replies
rphpacheco
Creator III
Creator III

QlikView does not accept average to average

Not applicable
Author

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

Please suggest.

rphpacheco
Creator III
Creator III

As these dates are formatted?

Could you post an example?

Not applicable
Author

Hello Pacheco,

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

rphpacheco
Creator III
Creator III

You can average the average in this way:
= (avg (FinalDateVsPurchasedDate) + avg (OfferedDateVsVisitedDate) + avg (PurchasedDateVsOfferedDate)) / 3

The average of the table has to be 92.70.

See if that's right?!?!

calvindk
Creator III
Creator III

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)

rphpacheco
Creator III
Creator III

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

jagan
Luminary Alumni
Luminary Alumni

Hi,

Hi,

Try using RangeAve

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

Hope this helps you.

Regards,

Jagan.