Forum Discussion
Need to fetch multiple values from the same table
- 5 years ago
Hello dsbuilder
check out this solution. It uses Table.Group and AddColumn. This will write your requested data in every column, no only in the first 🙂
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQzVAjKTE5V0lFSAONYHRRBIBPIccopTYWJuHmGuWJTZaTgXpSamocwDaLGSCEgvySxJD+1GM0KFAkgF2iaf04KsmBIuKsPdrtQXRTi6qej4OrjGubqR1gx0PpYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [L1column = _t, L2column = _t, Number_ext = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"L1column", type text}, {"L2column", type text}, {"Number_ext", type text}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"L1column"}, {{"AllRows", each _, type table [L1column=text, L2column=text, Number_ext=text]}}), #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Conc", each Text.Combine([AllRows][#"Number_ext"])), #"Expanded AllRows" = Table.ExpandTableColumn(#"Added Custom", "AllRows", {"L1column", "Number_ext"}, {"L1column.1", "Number_ext"}) in #"Expanded AllRows"Copy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hello dsbuilder
check out this solution. It uses Table.Group and AddColumn. This will write your requested data in every column, no only in the first 🙂
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQzVAjKTE5V0lFSAONYHRRBIBPIccopTYWJuHmGuWJTZaTgXpSamocwDaLGSCEgvySxJD+1GM0KFAkgF2iaf04KsmBIuKsPdrtQXRTi6qej4OrjGubqR1gx0PpYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [L1column = _t, L2column = _t, Number_ext = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"L1column", type text}, {"L2column", type text}, {"Number_ext", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"L1column"}, {{"AllRows", each _, type table [L1column=text, L2column=text, Number_ext=text]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Conc", each Text.Combine([AllRows][#"Number_ext"])),
#"Expanded AllRows" = Table.ExpandTableColumn(#"Added Custom", "AllRows", {"L1column", "Number_ext"}, {"L1column.1", "Number_ext"})
in
#"Expanded AllRows"
Copy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy