function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TilluTillu 

How to calculate average on Roll up field

I have a custo object  Business. and i have a field  'Amount' on this object. On Account i want to display average of this  'Amount' field. I have created a Roll Up on Account but it was giving only Count , SUM,MIN,MAX. Then How to calculate Average? for this
Puja_mfsiPuja_mfsi

Hi,

You need to create two rollup fields one for SUM and other for COUNT after that create a formula field in which divide the SUM rollup field to COUNt rollup field.

 

 

Please let me know if u have any problem on same and if this post helps u please throws KUDOS by click on star at left.

allay allayallay allay
Thanks Puja and Tillu
Suraj Tripathi 47Suraj Tripathi 47
Hi Tillu,

Step 1 : You need to create two rollup fields one for SUM 
Step 2 : For COUNT after that create a formula field in which divide the SUM rollup field to count 
rollup field.


Open the link for more information:- 

https://www.youtube.com/watch?v=U6PSXaQ0XRs

When you find the solution, mark this as best answer.

Thank you!

Regards,

Suraj Tripathi  
Atul Raj 12Atul Raj 12
Seven Mentor is the best Salesforce Training provider in the town , Being old and trustworthy from decades the question for frauds doesn't exits ,at Seven Mentor we provide an environment that will be perfect for student to acquire lots of knowledge at Salesforce course in Chennai we came up with best faculty across country , under our Salesforce Training in Chennai (https://www.sevenmentor.com/salesforce-classes-in-chennai), we guarantee you to build carrier in Salesforce Department .
Chaitanya WalukarChaitanya Walukar
create a two roll up summary field one for SUM it will give you back sum of total amount of all child records (if u havn't applied any filter/logi on the child records) then create 2nd roll up summary filed with Count() function it will give u back the total number of child records you have.  and now we already know the formula for calculation of Average (that is sum of amount/total no. of records in child obj (in your case) )   and now just create formule filed inside it derive the value by dividing the SUM() field by Count() filed thats it.

or you can write a trigger where u have to write a query for it. but point and click tools is good approch in this case.
 
Bram RockBram Rock
A roll-up summary is a field that calculates values from related records. For example, you (https://londoncarsrecovery.co.uk/) can calculate the average number of closed opportunities, or the average amount of closed opportunities, or the SUM, MIN, MAX number.
adam zampaadam zampa
Thank you, was looking for it everywhere and look where I found it.
Now we can offer some changes to our clients in Dragon Ball Series Mods (https://www.universalapk.com/dragon-ball-tap-battle-mod) and take the gaming experience to next level.
The TechieThe Techie
Hi,

Refer - https://www.youtube.com/watch?v=z6lI_ZO4SmE
Rahul Kumar 952Rahul Kumar 952
Saleforce is great, I have been using it for long time. I wish all developers good luck & to find great Birthday Wishes (https://wishesplus.com/), you can refer to this website. Thank you for sharing incredible knowledge.
galver tulixgalver tulix
To calculate the average on a roll-up field, you can follow a few steps. First, gather all the relevant data points that you want to include in the calculation. Then, sum up the values of the roll-up field across those data points. Next, divide the sum by the total number of data points to obtain the average. As an example, let's say we have a roll-up field called "Sales" that tracks the sales figures for different products in a company. We gather the sales data for three products: Product A, Product B, and Product C. The sales figures for these products are 100, 200, and 300, respectively. To calculate the average sales, we sum up these values (100 + 200 + 300 = 600) and divide by the number of data points (3 in this case), giving us an average of 200. Adding a touch of Hotstar mod latest (https://hotstarmodapk.com/), we can say calculating the average sales is as simple as watching your favorite show on Hotstar's latest modification.