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: 
Not applicable

Is Average of Average Possible in Qlikview

HI,

Is Is Average of Average Possible in Qlikview??

I have written Two expression in a Pivot with a dimension as Salesperson and SalesOrderID

1) Avg(OrderQty)

2) sum(OrderQty)/count(SalesID)

Now in other pivot i need and average of above 2 expression with dimension as SalesPerson??

avg(sum(OrderQty)/count(SalesID)) -- THIS IS NOT WORKING

avg( Avg(OrderQty)) -- THIS IS NOT WORKING

Pls any one can suggest an solution..

Thanks in advance.

Regards.

Ankit

4 Replies
Not applicable
Author

What are you actually trying to calculate.

An average of an average is not a sensible measure, you need a WEIGHTED average to get anything sensible.

steve

vgutkovsky
Master II
Master II

Ankit,

The only way to do this is with advanced aggregation:


avg(aggr(avg(OrderQty),SalesPerson))


Regards,

Not applicable
Author

Try this syntax


avg(aggr(sum(OrderQty)/count(SalesID),SalesPerson ))
avg( aggr( avg(OrderQty), SalesPerson ))

Hope this will work

Not applicable
Author

Just to reiterate what Steve Cavill stated, an average of an average should never be used as it will evaluate to a figure that is not a true average.