我正在尝试将主查询中的一些逻辑移到 lambda 中,以便主查询更易于阅读。
所以我想采取这样的逻辑:
T //columns: operation_Name
| extend path_Label = iif(operation_Name == '/', 'home', 'other')
//end up with columns: operation_Name, path_Label
我想将iif
逻辑移动到 lambda 中:
let translate_path = (operation_Name: string)
{
iif(operation_Name == '/', 'home', 'other')
};
T
| extend path_Label = invoke translate_path(operation_Name)
也试过:
let translate_path = (T:(operation_Name: string))`
{
T | extend path_Label = iif(operation_Name == '/', 'home', 'other')
};
T
| invoke translate_path()