make_list_with_nulls() (aggregation function)
Learn how to use the make_list_with_nulls() aggregation function to create a
dynamic JSON object (array) which includes null values.Creates a dynamic array of all the values of expr in the group, including null values.
Syntax
make_list_with_nulls(expr)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| expr | string | ✔️ | The expression that to use to create the array. |
Returns
Returns a dynamic JSON object (array) of all the values of expr in the group, including null values.
If the input to the summarize operator isn’t sorted, the order of elements in the resulting array is undefined.
If the input to the summarize operator is sorted, the order of elements in the resulting array tracks that of the input.
Example
The following example shows null values in the results.
let shapes = datatable (name:string , sideCount: int)
[
"triangle", int(null),
"square", 4,
"rectangle", 4,
"pentagon", 5,
"hexagon", 6,
"heptagon", 7,
"octagon", 8,
"nonagon", 9,
"decagon", 10
];
shapes
| summarize mylist = make_list_with_nulls(sideCount)
Output
| mylist |
|---|
| [null,4,4,5,6,7,8,9,10] |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.