Forum Discussion
Mic1979
1 year agoPost Partisan
Unpivot Columns using the list
Dear all, here my question. I have this sample table: I need to create a custom function to split the columns by the /, and then unpivot them to get this: As the original table is made...
- 1 year ago
Hi Mic1979
let
Source = Your_Source,
Text_Split = Table.TransformColumns(Source,
{{"Stuffing_Box_Material", each Text.Split(_, " / "), type text},
{"Body_Material", each Text.Split(_, " / "), type text}
}),
Expand1 = Table.ExpandListColumn(Text_Split, "Body_Material"),
Expand2 = Table.ExpandListColumn(Expand1, "Stuffing_Box_Material")
in
Expand2Stéphane
slorin
1 year agoSuper User
Hi Mic1979
let
Source = Your_Source,
Text_Split = Table.TransformColumns(Source,
{{"Stuffing_Box_Material", each Text.Split(_, " / "), type text},
{"Body_Material", each Text.Split(_, " / "), type text}
}),
Expand1 = Table.ExpandListColumn(Text_Split, "Body_Material"),
Expand2 = Table.ExpandListColumn(Expand1, "Stuffing_Box_Material")
in
Expand2
Stéphane
Mic1979
1 year agoPost Partisan
Hello slorin,
thanks for your code, I will accept it as a solution. If I wanted to make it more general, just to check to split those columns where the " / " is present, how to do this?
Thanks again