Forum Discussion
Power Query - Split and Trim Text at the same time
- Anonymous3 years ago
Hi JirkaZ ,
Thanks for this. It works on all the text fields, which is great. I've just used the last 2 steps, as I've amended my split to remove the number at the end of the name and use a list value instead:
#"Split Column by Delimiter - Creative" = Table.SplitColumn( #"Split Column by Delimiter - Line Item", "Taxonomy_Creative", Splitter.SplitTextByDelimiter(#"DV360 Creative - Delimiter", QuoteStyle.Csv), List.Transform(#"DV360 Creative - Fields", each Text.From(_))), MyColumns = Table.ColumnNames(#"Split Column by Delimiter - Creative"), Transformation = Table.TransformColumns(#"Split Column by Delimiter - Creative", List.Transform(MyColumns, each{_ , Text.Trim, type text})),But I have 2 date fields and a numerical field in my table. When I add in these steps, these values then show as errors. Is there any way for me to exclude these from the transformation? Or for it to only target text fields?
Thanks,
Mark
Actually, it would be good if the list of columns could just be a list of Text Columns. That way it can be a bit more dymanic, so I don't need to manually select the metrics fields to exclude.
Do you know how we could do this JirkaZ ?
- Anonymous3 years agoNot applicable
I've figured it out: if I change your Table.ColumnNames set to Table.ColumnsOfType and make sure I include nullable text, it gives me just the Text columns:
= Table.ColumnsOfType(#"Split Column by Delimiter - Creative", {type nullable text})Thanks,
Mark