[{"id":"a20f26ac-cd31-4e4d-9454-1e035b0f1587","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"3604b8ce-1da0-413f-8274-7df0f7173573","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"7fce7040-1bb1-4a61-9fb7-2e19d569de50","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"0eb72dd3-8f8f-4039-93a8-500bbde2301e","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"ac046cee-82b9-4edf-a642-ae6d7cb21ebf","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"75b66fd4-b740-443d-bc6e-1782048b60a6","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"dde44832-bb5c-45f3-8ebf-3badbc613cd9","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"43de3664-261b-4cf9-9945-fb519251f4c7","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"2f064d57-b088-4bc5-a628-4e0d7e1a0c65","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"f290406b-ced1-4c52-abad-979160a79f6b","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"1864834b-08ce-43f1-891b-c3cca6e04e95","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"f96cfec1-420c-4ca7-ab0a-cab482731073","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"3f2ea860-c764-43d8-ae3f-6e3b0314ce67","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"81eb70e8-f770-4384-9167-bc7c755ad052","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"d0dff477-9f56-483a-a9fc-cab648905b41","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"793a62d7-460d-4699-9304-edb2941268ac","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"2d6ebfad-f7d1-4cc5-8ba1-fdace3472056","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"c8c7b5d5-f5bd-4b68-a12f-3aae9804a844","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"577a09da-dea1-42db-812f-4eeaa9274ece","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"8ddd80d5-886f-41b8-8e3f-f73aa8146c8d","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"e0909540-8bde-4587-bb4d-02445746db2a","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"464b8e03-462d-4aed-8818-05d32ec3bf00","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"f235557b-9781-471f-bf03-38bae6e3e953","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"fd5d021d-0210-4d74-ba42-1a39ef14a385","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"548568fe-dbd1-4da5-a489-d9b3edf75329","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"a0c823ed-e22b-493b-aded-4d201c0fa480","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"d19bc9cd-ff53-4b0d-ab7e-a68c1497c4c6","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"94759fce-692f-4779-b5f3-fce5c58f242c","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"27658163-a479-432f-a192-dbed286beb3e","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]}]
        
(Showing Draft Content)

Aggregate Functions

To include summary values in a report, you can use aggregate functions described below. All of them have the optional scope argument that determines the set of data to use for the calculation. The scope argument could have one of the following values.

By default, the value of a scope argument is the current scope that depends on a report item that "hosts" the aggregate function. For example, in the Get Started with Tabular Reports demo, the table's group footer has the textbox that shows the {Sum(unitsInStock)} value. This is the call to the Sum aggregate function and the scope argument is omitted. It means that the calculation scope is the group instance. If a textbox with the same value resides in the table header instead, the calculation scope is the entire table.


Another optional argument of some aggregate functions is recursive that should be set to Recursive if you want to display summaries that include values from child groups in a recursive hierarchy. For example, the Interactive Hierarchy demo uses the {Sum(EmployeeCount, "EntityKey", "Recursive")} expression to display the cumulative Employee Count for cities, regions, and countries.

AggregateIf

Returns a conditional aggregated value of values specified by the expression, calculated in the specified scope.


Syntax


AggregateIf(condition, aggregate, expression, [scope])


Arguments

  • condition - the expression that evaluates to a boolean value indicating whether to include the expression into the calculation

  • aggregate - the name of the aggregate function to use for calculation, for example, Count

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

Examples


You can use the following expression to return the sum of the SalesAmount field values within the current scope. The result only includes SalesAmount values that are greater than 1000.

{AggregateIf(SalesAmount > 1000, "Sum", SalesAmount)}

Avg

Returns the average of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


Avg(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the average of SalesCount field values within the current scope.

{Avg(SalesCount)}

Count

Returns a count of non-null values specified by the expression, calculated in the specified scope.


Syntax


Count(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the number of UnitsOnOrder field values within the ProductsTable data region.

{Count(UnitsOnOrder, "ProductsTable")}

CountDistinct

Returns a number of distinct non-null values specified by the expression, calculated in the specified scope.


Syntax


CountDistinct(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the number of distinct CustomerId field values within the current scope.

{CountDistinct(CustomerId)}

CountRows

Returns a number of rows within the specified scope.


Syntax


CountRows([scope], [recursive])


Arguments

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the number of rows within the current scope.

{CountRows()}

DistinctSum

Returns the sum of distinct non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


DistinctSum(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the sum of distinct Size field values within the current scope.

{DistinctSum(Size)}

First

Returns the first value of the specified expression, calculated in the specified scope.


Syntax


First(expression, [scope])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

Examples


You can use the following expression to return the first value of the ProductName field in the ProductsTable data region.

{First(ProductName, "ProductsTable")}

Last

Returns the last value of the specified expression, calculated in the specified scope.


Syntax


Last(expression, [scope])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

Examples


You can use the following expression to return the last value of the SalesAmount field in the current scope.

{Last(SalesAmount)}

Max

Returns the maximum value of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


Max(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the maximum value of Size field values within the current scope.

{Max(Size)}

Median

Returns the median of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


Median(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the median of SalesAmount field values within the Sales data region.

{Median(SalesAmount, "Sales")}

Min

Returns the minimum value of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


Min(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the minimum value of Size field values within the current scope.

{Min(Size)}

Mode

Returns the value that appears most often among values specified by the expression, calculated in the specified scope.


Syntax


Mode(expression, [scope])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

Examples


You can use the following expression to return the most often value among values of the ReturnReason field within the current scope.

{Mode(ReturnReason)}

RunningValue

Returns a running aggregate of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


RunningValue(expression, aggregate, [scope])


Arguments

  • expression - the expression on which to calculate the summary value

  • aggregate - the name of the aggregate function to use for calculation, for example, Count

  • scope - the optional calculation scope

Examples


You can use the following expression to return the running value of the sum of the SalesAmount field values within the current scope.

{RunningValue(SalesAmount, "Sum")}

StDev

Returns the standard deviation of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


StDev(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the standard deviation of the ReturnAmount field values within the current scope.

{StDev(ReturnAmount)}

StDevP

Returns the population standard deviation of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


StDevP(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the population standard deviation of ReturnAmount field values within the current scope.

{StDevP(ReturnAmount)}

Sum

Returns the sum of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


Sum(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the sum of SalesAmount field values within the current scope.

{Sum(SalesAmount)}

Var

Returns the variance of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


Var(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the variance of the ReturnAmount field values within the current scope.

{Var(ReturnAmount)}

VarP

Returns the population variance of non-null numeric values specified by the expression, calculated in the specified scope.


Syntax


VarP(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the population variance of ReturnAmount field values within the current scope.

{VarP(ReturnAmount)}

ToArray

Returns an Array containing the values of the specified expression.


Syntax


ToArray(expression, [scope], [recursive])


Arguments

  • expression - the expression on which to calculate the summary value

  • scope - the optional calculation scope

  • recursive - the optional Recursive value indicating whether to perform the calculation recursively

Examples


You can use the following expression to return the ProductName field values separated by a comma within the current scope.

{Join(ToArray(ProductName), " ,")}