knowledgecenter-breadcrum

Knowledge Center

18 Mar, 2024

How to use aggregate in FetchXml

Posted on 18 Mar, 2024 by Shekhar Jain, Posted in Dynamics 365 Web Api Dynamics 365

Blogs

In this blog, we will learn how to use aggregate in FetchXml.

Available Aggregate

  • Count
  • CountColumn
  • Avg
  • Sum
  • Min 
  • Max

 

1. Count

It aggregates data based on specified conditions and returns a numerical value representing the count of records meeting those conditions.

Output:

2. CountColumn

This attribute helps group data based on the values in a chosen column.

Output:

3. Sum

The "sum" function is used to calculate the total sum of numerical values within a specified column or attribute.

Output:

4. Avg

The "avg" function calculates the average value of numerical data within a specified column or attribute.

Output:

5. Min

The "min" function retrieves the minimum value of numerical data within a specified column or attribute.

Output:

6. Max

The "max" function retrieves the maximum value of numerical data within a specified column or attribute.

Output:

 

Below are points to note that differ from a regular query.

  • Set the fetch element aggregate attribute to true.
  • Set the alias attribute for each attribute element.
  • Set the aggregate attribute for each attribute element 

Comment

This is a Required Field

Loading

Recent Updates

Thumbnail D365 Sales
Blogs
09 Apr, 2025

What Is Dynamics 365 Sales? A Comprehensive Guide

What Is Dynamics 365 Sales? A Comprehensive Guide Microsoft has become a leader in business applications with its suite of…

READ MORE
Blogs
02 Apr, 2025

Quality is not just an option; it’s a responsibility

In the world of software development, testing is often seen as an optional phase, especially when there is no dedicated…

READ MORE
Thumbnail
Blogs
26 Mar, 2025

What is Power Virtual Agents: Exploring AI-Driven Virtual Chatbots?

What is Power Virtual Agents: Exploring AI-Driven Virtual Chatbots? In today’s digital landscape, businesses are constantly seeking ways to enhance…

READ MORE