0

我正在尝试从编译时未知的表中动态创建查询和过滤器(具体来说,id如果我正在查询requests表,我想过滤,operation_ParentId否则)。以下失败,因为id不是表中的列exceptions

let dataset = exceptions;
dataset
| where (itemType == "request" and id == "test") or (itemType != "request" and operation_ParentId == "test")

提前致谢!

4

2 回答 2

0

这可以使用columnifexists()

let dataset = exceptions;
dataset
| where (itemType == "request" and columnifexists("id", operation_ParentId) == "test") or (itemType != "request" and operation_ParentId == "test")
于 2018-03-20T01:20:23.237 回答
0

您可以“联合”这两个表:

let dataset = union exceptions, requests;
...
于 2018-04-09T17:29:30.283 回答