Forum Discussion
Rename rows
- 4 years ago
karelstoel
Can you share some sample data with the expected results? - 4 years ago
Hi Fowmy,
See below what I am looking for. I Would like to rename the rows so I can see what data is what. Thanks!
- 4 years ago
Hi karelstoel ,
Maybe you could add an index column and then replace the value of that column.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcklNyixJLS1KzVPSUTJQitVBEzIy0LM0NjU3wZQxNDDQMzM2MDHHlDI1t9AzMTQ1M8VinqWxBdBEY3NjLCYamVoY6plbGFsCNcYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Naam = _t, Debiteuren = _t]), #"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1, Int64.Type), #"Changed Type1" = Table.TransformColumnTypes(#"Added Index",{{"Index", type text}, {"Debiteuren", type number}}), Substitutions = [ 1 = "Company X", 2 = "Company Y", 3 = "Company Z", 4 = "Company V", 5 = "Company K", 6 = "Company J"], Substituted = Table.TransformColumns(#"Changed Type1", {{"Index", each Record.FieldOrDefault(Substitutions, _, _)}}) in SubstitutedIf the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Fowmy,
See below what I am looking for. I Would like to rename the rows so I can see what data is what. Thanks!
Hi karelstoel ,
Maybe you could add an index column and then replace the value of that column.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcklNyixJLS1KzVPSUTJQitVBEzIy0LM0NjU3wZQxNDDQMzM2MDHHlDI1t9AzMTQ1M8VinqWxBdBEY3NjLCYamVoY6plbGFsCNcYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Naam = _t, Debiteuren = _t]),
#"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1, Int64.Type),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Index",{{"Index", type text}, {"Debiteuren", type number}}),
Substitutions = [
1 = "Company X",
2 = "Company Y",
3 = "Company Z",
4 = "Company V",
5 = "Company K",
6 = "Company J"],
Substituted = Table.TransformColumns(#"Changed Type1", {{"Index", each Record.FieldOrDefault(Substitutions, _, _)}})
in
Substituted
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.