QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for
Did you mean:
Highlighted
Not applicable

How to calculate Sum of Means ?

Help me write some expressions, attached is the sample document

My first chart i.e. "Avg Mean Price Per Product" would be like

Sum(Mean price of all purchases of a customer)/Total Number of Customers

My first chart i.e. "Avg Mean Price Per Product" would be like

Sum(Max price of all purchases of a customer)/Total Number of Customers

***     There can be multiple purchases for a product against single customer. I have updated the document too.

Any help is highly appreciated.

Message was edited by: Mubbasher Khaliq (Multiple purchases for a product against single customer added)

Tags (5)
1 Solution

Accepted Solutions
Highlighted
Master II

Re: How to calculate Sum of Means ?

You should add Customer as dimension to aggr, otherwise you choose to calculate aggr() regardless of customer (aka total<> modifier).

10 Replies
Highlighted
Employee

Re: How to calculate Sum of Means ?

If you want to average per customer, then sum the averages, you should use

Sum(Aggr(Avg(Price),Customer))

HIC

Highlighted
Master II

Re: How to calculate Sum of Means ?

Hi.

aggr() function can help you to calculate the expression for the aggregation level that differs from the chart dimensions.

Highlighted
MVP

Here it is

Highlighted
Specialist

Re: How to calculate Sum of Means ?

Hi,

Have a look on RangeAvg() function.

Highlighted
Master II

Re: How to calculate Sum of Means ?

See the attached file

Highlighted
Not applicable

Re: How to calculate Sum of Means ?

Thanks, This helped me a lot , but when I write this expression

If within Aggr function I use Sum/Count rather than Avg then the out put of Count is not right. As can be seen below.

Expression:

Sum(Aggr(Count(1),Product))

Output:

Why it is counting every product count against single customer.

Desired Output:

Highlighted
Not applicable

Highlighted
Master II

Re: How to calculate Sum of Means ?

You should add Customer as dimension to aggr, otherwise you choose to calculate aggr() regardless of customer (aka total<> modifier).