Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
martynlloyd
Partner - Creator III
Partner - Creator III

AGGR problem

Hi, I have a table like the one below. I am calculating average (mean) cost per unit for dimension 1

Dimension 1 Can be Dealer, Customer, or Model

I need to calculate a benchmark of the average of all rows in the set of data, and display it next to the individual dim cost as a comparison.

I have tried using

  Aggr(sum([Claim Total])/sum(CountUnit),Dealer)

where CountUnit is 1 for each unit (instead of using Count(Unit)

However, the result is not at all what I am expecting; as you can see the benchmark is supposed to be 213.33

DealerUnitsClaimsCostLabourPartsMisc.Per UnitBenchmark
Dealer 111£105.95£105.95£0.00£0.00£105.95-
Dealer 214£124.72£124.72£0.00£0.00£124.72£124.72
Dealer 322£232.38£227.62£4.76£0.00£116.19£116.19
Dealer 436£549.48£535.20£14.28£0.00£183.16£183.16
Dealer 524£672.44£653.40£19.04£0.00£336.22£336.22
Dealer 634£38.60£18.90£19.70£0.00£12.87£12.87
Dealer 7310£770.12£735.42£34.70£0.00£256.71£256.71
Dealer 811£88.56£16.67£71.89£0.00£88.56-
Dealer 959£993.97£917.78£76.19£0.00£198.79-
Dealer 10420£1,756.94£1,680.42£76.52£0.00£439.24-
TOTAL25 £5,333.16 £213.33

Many thanks for your help

M.

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

sum(TOTAL [Claim Total])/sum(TOTAL CountUnit)

View solution in original post

4 Replies
anbu1984
Master III
Master III

sum(TOTAL [Claim Total])/sum(TOTAL CountUnit)

Anonymous
Not applicable

should be sum(total [Claim Total])/sum(total CountUnit)

Anonymous
Not applicable

Include the time frame field name in your aggregate Function.

Aggr(Sum({1}[Claim Total]/CountUnit),Dealer,Date)

maxgro
MVP
MVP


sum(total Cost)  / sum(total Units)

replace Cost and Units with your field