Aggregate FunctionsPercentile & Sketch
hll_if
Creates a HyperLogLog sketch for records where the predicate evaluates to true.
Syntax
hll_if(expr, predicate)Parameters
Prop
Type
Returns: dynamic
Syntax
hll_if(expr, predicate, accuracy)Parameters
Prop
Type
Returns: dynamic
Examples
Example 1 — HyperLogLog sketch of elite warriors per clan
datatable(warrior:string, elite:bool, clan:string)[
"Ragnar", true, "Lothbrok",
"Floki", false, "Lothbrok",
"Harald", true, "Fairhair"
]
| summarize hll_if(warrior, elite) by clan| clan (string) | hll_if_warrior (dynamic) |
|---|---|
| Fairhair | [[1,14],["5968294527843184544"],[]] |
| Lothbrok | [[1,14],["-81600670940795597"],[]] |
Example 2 — With explicit accuracy parameter
datatable(warrior:string, elite:bool, clan:string)[
"Ragnar", true, "Lothbrok",
"Floki", false, "Lothbrok",
"Harald", true, "Fairhair",
"Bjorn", true, "Lothbrok"
]
| summarize hll_if(warrior, elite, 1) by clan| clan (string) | hll_if_warrior (dynamic) |
|---|---|
| Fairhair | [[1,14],["5968294527843184544"],[]] |
| Lothbrok | [[2,14],["-81600670940795597","7530398182789397426"],[]] |