使用Power Query同时展开电子表格中的所有列。我把电子表格从这里转过来:
转置列:(https://i.stack.imgur.com/vZnnY.png)
展开一列:(https://i.stack.imgur.com/qf9Rp.png)
展开所有列:(https://i.stack.imgur.com/v3FYk.png)
在excpand列之后,其创建重复数据
我现在使用的是这个代码:
let
Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
#"Renamed Columns" = Table.RenameColumns(Source,{{"instrument_key", "Symbol1"}}),
#"Invoked Custom Function" = Table.AddColumn(#"Renamed Columns", "Symbol.1", each Symbol([Symbol1])),
#"Removed Columns" = Table.RemoveColumns(#"Invoked Custom Function",{"symbol", "year", "W/M", "Strike", "Option", "Symbol1", "tradingsymbol", "Lot"}),
#"Transposed Table" = Table.Transpose(#"Removed Columns")
in
#"Transposed Table"
我期待展开所有列一个接一个witout像这样重复
就像这样:(https://i.stack.imgur.com/AR0R1.png)
1条答案
按热度按时间jgovgodb1#
如果总是有3列和一行,并且开始是Source,则