Reputation: 11
I would like to select one Column, may be Column 1, without knowing the name.
How can I get access on (A) the data of this Column and (B) its name?
Thanks a lot in advance for your help
Kind regards Jens
Upvotes: 1
Views: 3552
Reputation: 1530
let
src1 = #table({"k1", "v1", "z3"}, {{"k11", 11, 10}, {"k12", 12, 20}, {"k13", 13, 30}, {"k14", 14, 40}}),
cols_all = Table.ColumnNames(src1),
col_indexed = cols_all{2},
table_final = Table.SelectColumns(src1, col_indexed)
in
table_final
let
src1 = #table({"k1", "v1", "z3"}, {{"k11", 11, 10}, {"k12", 12, 20}, {"k13", 13, 30}, {"k14", 14, 40}}),
cols_all = Table.ColumnNames(src1),
col_indexed = cols_all{2},
list_final = Table.Column(src1, col_indexed)
in
list_final
Upvotes: 2