Forum Discussion
Mohanraj87
2 years agoFrequent Visitor
Dynamically removing columns ending with even numbers
Hi All, In Power Query, I have split a column based on "," delimiter and the result produced one column split into 10 columns and columns names have been named as "Column_1", "Column_2", and till...
- 2 years ago
Hi
With 10 columns
= Table.SplitColumn(#"Changed Type 1", "Details", each List.Alternate(Text.Split(_,","),1,1,1), 10)
or
= Table.SplitColumn(
#"Changed Type 1",
"Details",
each List.Alternate(Text.Split(_,","),1,1,1),
List.Max(
Table.TransformColumns(
#"Changed Type 1",
{{"Details", each Number.IntegerDivide(Text.Length(Text.Select(_,",")) + 1, 2) + 1, Int64.Type}}
)[Details]
)
)https://goodly.co.in/split-by-variable-columns-in-power-query/
Stéphane
slorin
2 years agoSuper User
Hi
With 10 columns
= Table.SplitColumn(#"Changed Type 1", "Details", each List.Alternate(Text.Split(_,","),1,1,1), 10)
or
= Table.SplitColumn(
#"Changed Type 1",
"Details",
each List.Alternate(Text.Split(_,","),1,1,1),
List.Max(
Table.TransformColumns(
#"Changed Type 1",
{{"Details", each Number.IntegerDivide(Text.Length(Text.Select(_,",")) + 1, 2) + 1, Int64.Type}}
)[Details]
)
)
https://goodly.co.in/split-by-variable-columns-in-power-query/
Stéphane
Mohanraj87
2 years agoFrequent Visitor
Thanks you very much slorin your solution worked like a charm.