2017-07-11 22 views
0

我正在使用电源查询m语言。我创建写了这个代码试图用m代码在电源查询中创建并扩展表格

let 
    Source = #table(    
       {"first", "second"}, 
       { 
        {Table.ExpandRecordColumn(Table.FromRecords({[order_id = "a_01", place = "america", price = 700]}), "first", {"order_id", "place", "price"}), "dd"} 
       } 
      ) 
in 
    Source 

其实我想创建的代码&立即设法第一列内展开它的表的空白查询&。但它显示以下错误 Expression.Error:找不到表的第一列。 细节: 第一个

我不明白这个问题。请帮帮我。

回答

1

这是你想要做什么?

let 
Source = #table(    
      {"first", "second"}, 
      { 
       {Table.ExpandRecordColumn(Table.FromRecords({[first = [order_id = "a_01", place = "america", price = 700]]}), "first", {"order_id", "place", "price"}), "dd"} 
      } 
     ), 
#"Expanded first" = Table.ExpandTableColumn(Source, "first", {"order_id", "place", "price"}, {"order_id", "place", "price"}) 
in 
#"Expanded first" 

它给出了这样的输出:

enter image description here

0

first不是您传递给Table.ExpandRecordColumn的列的列。这些列是order_idplaceprice。如果要扩展#table中的first列,则需要使用Table.ExpandTableColumn,并且需要使用#table作为其第一个参数。