I want to write a Kusto function with an optional argument. If the argument is not provided, I don’t want to do a ‘where’ statement. Is that possible?
let f = (a:string = "default") {
table1
| where region = a // only do this search if a != default
};
f()
>Solution :
you can use the logical or operator:
let f = (a:string = "default") {
table1
| where a == 'default' or region == a
};
f()