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 [, MaxListSize])

Arguments

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

Note

An legacy and obsolete variant of this function: makeset() has a default limit of MaxListSize = 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 just count the distinct values, use dcount()

Example

PageViewLog 
| summarize countries=make_set(country) by continent

alt text

See also the mv-expand operator for the opposite function.