Following FetchXML calculates average of estimated value from opportunity.
Explanation
To calculate average set following:- Set aggregate to true in <fetch> clause.
- In <aggregate> attribute set aggregate to avg
Limitation with null values while computing average
Null values are not considered when Microsoft Dynamics CRM computes the average of data. However, zero (0) is used.In the following example, with the following data, the average for Account 1 (two entries) is shown as 250 whereas the average for Account 2 (two entries) is shown as 125.
Topic | Potential Customer | Estimated value |
---|---|---|
Opportunity 1 | Account 1 | null |
Opportunity 2 | Account 1 | 250 |
Opportunity 3 | Account 2 | 0 |
Opportunity 4 | Account 2 | 250 |
No comments:
Post a Comment