kusto - 表格单元格值 [英] kusto - table cell value
问题描述
大家好,
我是Kusto的新手 - 并且想知道是否可以将表格单元格的值存储在变量中?
I'm new to Kusto - and would like to know if it is possible to store the value of a table cell in a variable?
例如,我有两个自定义ID。只有一行有两个值,其余的事件只有'Id'填写。我需要能够使用'parentId'来获取值'Id'
for example, i have two custom ids. Only one row has both values, the rest of the events have only 'Id' filled in. I need to be able to use 'parentId' to get the value 'Id'
event1   parentId的    ID
event2                 Id
event3                 Id
event1 parentId Id
event2 Id
event3 Id
推荐答案
嗨 Sa'Ed A'Rafat,
Hi Sa'Ed A'Rafat,
感谢您的联系!
是的,可以存储a的值使用函数toscalar()的变量中的表格单元格
Yes, it is possible to store the value of a table cell in a variable using the function toscalar()
https://docs.microsoft.com/en-us/azure/kusto/query/toscalarfunction
以下是您可以使用的示例:
Here is a sample that you can use:
let id = toscalar(customEvents
| where customDimensions ['parentId'] != ''
| project customDimensions ['Id'] );
customEvents
| where customDimensions ['Id'] == tostring(id)
此处,变量'id'将存储 的值; customDimensions ['Id'],其中填充了customDimensions ['parentId']。您可以使用该变量查询customEvents。
Here, the variable 'id' will store the value of customDimensions ['Id'] which has customDimensions ['parentId'] populated. You can query customEvents using that variable.
您也可以使用以下查询而不将Id存储在变量中:
You can also just use the below query without storing the Id in a variable:
customEvents
| where customDimensions ['parentId'] != ''
| project customDimensions ['Id']
希望这会有所帮助!
这篇关于kusto - 表格单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!