小编she*_*fly的帖子

Kusto:如何取消旋转 - 将列变成行?

使用帮助集群上 Samples 数据库上的 StormEvents 表:

StormEvents
| where State startswith "AL"
| where EventType has "Wind"
| where StartTime == "2007-01-02T02:16:00Z"
| project StartTime, State, EventType, InjuriesDirect, InjuriesIndirect, DeathsDirect, DeathsIndirect
Run Code Online (Sandbox Code Playgroud)

我想要表单的基于行的输出:

所需的非旋转输出

我看到了 pivot() 函数,但它似乎只向另一个方向前进,从行到列。

我一直在尝试各种 pack() 想法,但似乎无法获得所需的输出。

例子:

StormEvents
| where State startswith "AL"
| where EventType has "Wind"
| where StartTime == "2007-01-02T02:16:00Z"
| project StartTime, State, EventType, InjuriesDirect, InjuriesIndirect, DeathsDirect, DeathsIndirect
| extend Packed =   pack(
                    "CasualtyType", "InjuriesDirect", "CasualtyCount", InjuriesDirect,
                    "CasualtyType", "InjuriesIndirect", "CasualtyCount", InjuriesIndirect,
                    "CasualtyType", "DeathsDirect", "CasualtyCount", DeathsDirect, …
Run Code Online (Sandbox Code Playgroud)

azure-log-analytics kql azure-data-explorer

2
推荐指数
1
解决办法
3403
查看次数