1

I have my data in the format

enter image description here

I need to transform the data into [source, destination and count] format

enter image description here

so that I can create a sankey chart out of it. Can I do any transform like this in Kusto itself or is this possible only via a programming language? If it can be done in kusto itself, can you point the way please.

4

1 回答 1

3

使用mv-apply运算符可以转换动态数组,然后您可以使用prev()函数获取前一行的值以生成From列:

datatable (IdCol:long, Ordered_States_List:dynamic )
[1,dynamic(["State01","State02","State05"]),
2,dynamic(["State02","State03","State05"]),
3,dynamic(["State01","State04"]),
4,dynamic(["State01","State02","State03"])]
| mv-apply Ordered_States_List to typeof(string) on 
(
    project From = prev(Ordered_States_List), To=Ordered_States_List
)
| where isnotempty(From)
| summarize value=count() by From, To
于 2019-12-02T11:39:20.767 回答