[{"id":"425f2be4-b65d-4cdf-b543-fb4397f51672","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"a1041c29-1f9f-497e-b577-3e673e487c51","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"c1e3b2a0-7159-4980-a5e1-4fbb04c7fcc1","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"128acbbc-5c49-416b-9c1f-91f679362b23","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"3bc7a653-1dd3-4a33-b35c-41b0ddc2f446","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"cecedb46-bf12-401c-a04c-5282e11b8274","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"2f1768df-3e8b-41c2-826e-93f1a82273d1","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"d9528848-3bae-42c1-8f6d-410a78341cef","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"2683b3de-5c23-429d-9a88-4917616d20ad","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"b96827a0-6bd4-4184-86a4-6fe503d0e4b4","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"96d2140c-5bb6-49b6-a4c7-4af4b7de2e52","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"11f27d32-9547-4a8c-9e88-5dd2bffffeda","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"d186bc7e-cbae-4d23-9cd9-a54880be8e4d","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"26754bf1-707e-4815-b6d3-dcdc87a59188","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"e4c0a89e-cceb-4863-a30a-dff94f1d8d08","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"c4f826a6-5d16-4399-8f1a-7b8449594941","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"ff2b9815-2596-47f7-8793-3585c9ee24a2","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"46851ce2-51a2-4af4-969d-9fe989997135","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"e3e87330-5250-4923-9cdf-e7e8afd353ab","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"a04db983-f77b-4ec6-857c-1c01afaed85a","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"434eed34-9059-46e4-88f9-15e47d09622c","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"30988f2a-ebd5-4a8c-b20e-54a11a528d30","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"a59719c8-0df2-44e1-b89c-9d8fa0312857","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"4be1ecee-287b-43a2-ba99-cfa89de88187","tags":[{"product":null,"links":null,"id":"4d7b6a40-ab32-4c71-a381-58f3ffd2653e","name":"new","color":"#ed7422","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"ea04cced-7866-48e5-a5fe-1e9f11004d59","tags":[{"product":null,"links":null,"id":"fe610228-9cf6-417f-813a-dcbfd25406c3","name":"upd","color":"#7e678a","productId":"d699a6af-e150-4da3-ab30-25fd97934601"}]},{"id":"ab17d080-0112-4ba4-8dae-ef367bec7b78","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), " ,")}