Saturday, 16 April 2016

Min Aggregate - FetchXML Query

Min aggregate returns the minimum value in a specified column.
Null values are not considered when Microsoft Dynamics CRM computes the minimum of data. However, zero (0) is used.
The following FetchXML shows how to get the maximum value from estimated column of opportunity entity.
  1. <fetch distinct='false' mapping='logical' aggregate='true'>
  2. <entity name='opportunity'>
  3. <attribute name='estimatedvalue' alias='estimatedvalue_min' aggregate='min' />
  4. </entity>
  5. </fetch>
To get minimum value from a column set:
  • Set aggregate to true in fetch node.
  • Set aggregate to min in aggregate attribute.
- See more at:

No comments:

Post a Comment