make_set() (aggregation function)

Returns a dynamic (JSON) array of the set of distinct values that Expr takes in the group.

  • Can be used only in context of aggregation inside summarize

Syntax

summarize make_set(Expr [, MaxSize])

Arguments

  • Expr: Expression for aggregation calculation.
  • MaxSize is an optional integer limit on the maximum number of elements returned (default is 1048576). MaxSize value cannot exceed 1048576.

Note

makeset() is a legacy and obsolete version of the function make_set. The legacy version has a default limit of MaxSize = 128.

Returns

Returns a dynamic (JSON) array of the set of distinct values that Expr takes in the group. The array's sort order is undefined.

Tip

To only count distinct values, use dcount()

Example

PageViewLog 
| summarize countries=make_set(country) by continent

Table showing Kusto Query summarize countries by continent in Azure Data Explorer

See also

  • Use mv-expand operator for the opposite function.
  • make_set_if operator is similar to make_set, except it also accepts a predicate.