我试图从编译时未知的表中动态创建查询和过滤器(具体来说,如果我查询id
,我想在requests
上过滤表,operation_ParentId
否则)。以下操作失败,因为id
不是exceptions
表中的列:
let dataset = exceptions;
dataset
| where (itemType == "request" and id == "test") or (itemType != "request" and operation_ParentId == "test")
提前致谢!
答案 0 :(得分:0)
可以使用columnifexists()
:
let dataset = exceptions;
dataset
| where (itemType == "request" and columnifexists("id", operation_ParentId) == "test") or (itemType != "request" and operation_ParentId == "test")
答案 1 :(得分:0)
你可以“联合”这两个表:
let dataset = union exceptions, requests;
...