I’m a newbie to Excel Power Queries (M language) and would appreciate some help. I have a table with a list of records called ‘repTbl’. I wish to extract the contents of each record (2 records in the example below), and combine them into a single table.
Is there a way to do this efficiently using a loop or?
*CODE
let
Source = Json.Document(Web.Contents()),
aggregateByTradeLite = Source[aggregateByTradeLite],
#”Converted to Table” = Table.FromList(aggregateByTradeLite, Splitter.SplitByNothing(), null, null, ..
repTbl = Table.ExpandRecordColumn(#”Converted to Table”, “Column1”, {“reportResponse”},{“Column1.reportResponse”}),
** # LOOP 1**
tmp = repTbl{0}[Column1.reportResponse],
resetNotionalReport = tmp[resetNotionalReport],
tmpTbl1 = Table.FromList(resetNotionalReport, Splitter.SplitByNothing(), null, null … ),
tbl1 = Table.ExpandRecordColumn(tmpTbl1, "Column1", {"productType", "currency", "index"} {"Column1.productType", "Column1.currency", "Column1.index"}),
** # LOOP 2**
tmp2 = repTbl{1}[Column1.reportResponse],
resetNotionalReport2 = tmp2[resetNotionalReport],
tmpTbl2 = Table.FromList(resetNotionalReport2, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
tbl2 = Table.ExpandRecordColumn(tmpTbl2, “Column1”, {“productType”, “currency”, “index”}, {“Column1.productType”, “Column1.currency”, “Column1.index”}),
** # COMBINE TABLES **
combinedTable = Table.Combine({tbl1, tbl2, tbl3}),
in
combinedTable
*
Bella Grubb is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.