Consider the following KQL query:
datatable(Value:int, ts:datetime) [
10, datetime(2022-03-30),
20, datetime(2022-03-30),
10, datetime(2022-03-31),
20, datetime(2022-03-31),
]
| where ts == '2022-03-30'
| summarize count() by Value
I would like to save it as a function without the timestamp filter, of course. Suppose this function would be named MyFunc. It should accept the timestamp as a parameter and called like this:
MyFunc('2022-03-30')
The Microsoft documentation implies it is possible to save a function with parameters, but I do not understand how exactly am I to define such a function.
So, what am I missing? How can we save a function with parameters? This way I could have a reusable function that does grouping.
EDIT 1
So I modified the code:
datatable(Value:int, ts:datetime) [
10, datetime(2022-03-30),
20, datetime(2022-03-30),
10, datetime(2022-03-31),
20, datetime(2022-03-31),
]
| where ts == p_ts
| summarize count() by Value
But when I am trying to save it, the dialog has no parameters:

What am I missing?


