12 Replies Latest reply: Jun 2, 2014 2:46 PM by Henric Cronström

# AVG calculation

Dear All,

I am calculating AVG

=sum(Dollars)/Count(standardID) (60663/2823)=21%

I have a doubt is this correct way to calculate AVG

please some one guide me

Niranjan

• ###### Re: AVG calculation

Try this

Avg(Aggr(sum(Dollars)/Count(standardID), Dimension))

Ale

• ###### Re: AVG calculation

AVG Occupancy cost per person i want to calculate

i have only two dimension

how can i calculate this secnario

BEst Regards,

Niru

• ###### Re: AVG calculation

Then you should calculate total cost and divide by number of persons. Hence:

Sum(Dollars) / Count( distinct PersonID )

Aggr is not needed here.

HIC

• ###### Re: AVG calculation

Updated the details now

Sorry i forget to add the dimension details

Check your output with the expected manual result if it gives result then it will correct other wise you can use Avg function for this. And if the fields which is in Numerator or denominator has proper relation then it will correct for you.

You can also try with

=Aggr( sum(Dollars)/Count(standardID), DimensionName )

Or

=Avg( Aggr( sum(Dollars)/Count(standardID), DimensionName ))

• ###### Re: AVG calculation

Hi,

21% is wrong. What your result means is an average of  21.49 Dollars per standardID.

Eduardo

• ###### Re: AVG calculation

Dear All,

AVG Occupancy cost per Person

=sum(Dollars)/Count(standardID)

=60663/2823

How can i calculate AVG of cost per person

Best regards,

Niranjan

• ###### Re: AVG calculation

Avg(Aggr(sum(Dollars)/Count(standardID), Person))

Regards

• ###### Re: AVG calculation

If you calculate this in any chart then use

Dimension:- Person

Exper :- =Avg( (sum(Dollars)/Count(standardID) ) )

And if calculate this in any text box then

=Avg(Aggr(sum(Dollars)/Count(standardID), Person))

• ###### Re: AVG calculation

=avg(aggr(sum([Current Month Dollars])/Count(DISTINCT [Standard ID]),[Full Name])) result is =1014

=sum([Current Month Dollars])/Count(DISTINCT [Standard ID])  result is =21

which is the correct result ,which one should i follow    (60663/2823 )

Best Regards,

Niranjan

• ###### Re: AVG calculation

Second one is seems right but without see the whole data not confirm you need to check from your side. Also as Henric suggest do not use Aggr and use PersonId in place of Standard ID but if the Personid has same Id as the Standard Id then use that.

• ###### Re: AVG calculation

It depends what you want to calculate. Dollars per standardID? Then Sum(Dollars)/Count(distinct standardID). Note the "distinct".

Or per something else? See more on Average – Which average?

HIC