Forum Discussion
Anonymous
2 years agoNot applicable
Removing Last Delimiter from Each Row
The goal is to remove the last comma delimiter of each row. Some rows have one item and is finalized with a comma delimiter. Some rows have multiple items separated by comma delimiters. But all rows ...
- 2 years ago
Anonymous Use the Transform tab. Extract, text before delimiter. Use comma as delimiter and From the end of input and 0.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcspJTM7WUYrVgTEVwjMyS1J1FIJSU2DCpUCuf1FiXnoqRMS9KDU1T0cBIgHVBVKOUBQLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Test_Data = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Test_Data", type text}}), #"Extracted Text Before Delimiter" = Table.TransformColumns(#"Changed Type", {{"Test_Data", each Text.BeforeDelimiter(_, ",", {0, RelativePosition.FromEnd}), type text}}) in #"Extracted Text Before Delimiter"
Greg_Deckler
2 years agoCommunity Champion
Anonymous Use the Transform tab. Extract, text before delimiter. Use comma as delimiter and From the end of input and 0.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcspJTM7WUYrVgTEVwjMyS1J1FIJSU2DCpUCuf1FiXnoqRMS9KDU1T0cBIgHVBVKOUBQLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Test_Data = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Test_Data", type text}}),
#"Extracted Text Before Delimiter" = Table.TransformColumns(#"Changed Type", {{"Test_Data", each Text.BeforeDelimiter(_, ",", {0, RelativePosition.FromEnd}), type text}})
in
#"Extracted Text Before Delimiter"- Anonymous2 years agoNot applicable
Greg_Deckler omg I feel so stupid bc I totally knew that. Regardless, thank you for your advice.
- Greg_Deckler2 years agoCommunity Champion
Anonymous No worries! You shouldn't feel stupid, we all forget stuff we have learned at some point! Happens to me all the time!