I have a query in our domain which I can not get it to work. I used datatable to mimic my issue. I'm trying to use a projected value in an userdefined function.
// this works
let f = (a:int) {
datatable (b:string, d:int) ["2015-12-31", 1, "2016-12-30", 2, "2014-01-05", 3]
| as dataset
| where d == a
| project b;
};
datatable (d:int) [1, 2, 3]
| as dataset
| project toscalar(f(2))
// this doesnt work, why is the 'd' not used (projected) in function q.
// if I add toscalar to the project it also doesnt work
let f = (a:int) {
datatable (b:string, d:int) ["2015-12-31", 1, "2016-12-30", 2, "2014-01-05", 3]
| as dataset
| where d == a
| project b;
};
datatable (d:int) [1, 2, 3]
| as dataset
| project toscalar(f(d))
What am I missing here, I expect the '| project' use the function (f) for each result.
here the 2 queries to tinker with.
thanks
