take_any
Returns an arbitrary non-null value from the group.
Syntax
take_any(val)Parameters
Prop
Type
Returns: bool
Syntax
take_any(val)Parameters
Prop
Type
Returns: int
Syntax
take_any(val)Parameters
Prop
Type
Returns: long
Syntax
take_any(val)Parameters
Prop
Type
Returns: real
Syntax
take_any(val)Parameters
Prop
Type
Given a dynamic field
This parameter is string-only. In permissive mode — the default — almost every field arrives as a dynamic, so passing one works because Berserk injects asstring: extract-or-null, the value when it really is a string and null otherwise, so the call yields null (a predicate yields false). A property bag or array is therefore not matched, and tostring() is never applied implicitly — use it explicitly to match a bag's JSON text, keys included. Strict mode rejects the dynamic instead of coercing it. See String coercion and the asXXX family.
Returns: string
Syntax
take_any(val)Parameters
Prop
Type
Returns: datetime
Syntax
take_any(val)Parameters
Prop
Type
Returns: timespan
Syntax
take_any(val)Parameters
Prop
Type
Returns: guid
Syntax
take_any(val)Parameters
Prop
Type
Returns: dynamic
Examples
Example 1 — Pick an arbitrary warrior name per clan
datatable(warrior:string, clan:string)[
"Ragnar", "Lothbrok",
"Bjorn", "Lothbrok",
"Harald", "Fairhair",
"Ivar", "Lothbrok"
]
| summarize take_any(warrior) by clan| clan (string) | take_any_warrior (string) |
|---|---|
| Fairhair | Harald |
| Lothbrok | Ragnar |
Example 2 — Pick arbitrary values from multiple columns per group
datatable(clan:string, warrior:string, region:string)[
"Lothbrok", "Ragnar", "Kattegat",
"Lothbrok", "Bjorn", "Uppsala",
"Lothbrok", "Ivar", "Kattegat",
"Fairhair", "Harald", "Vestfold",
"Fairhair", "Halfdan", "Vestfold"
]
| summarize take_any(warrior), take_any(region) by clan| clan (string) | take_any_warrior (string) | take_any_region (string) |
|---|---|---|
| Fairhair | Harald | Vestfold |
| Lothbrok | Ragnar | Kattegat |