Forum Discussion
Axel_hnk
4 years agoFrequent Visitor
Replace Leading Characters for Multiple Columns at Once
Hi there, I have always a couple of columns in my data source where the data has leading (in my case) zero. I get rid of them by: Table.TransformColumns(#"StepBefore", {{"ColumnName", each Text.Tri...
- 4 years ago
Simple enough,
= List.Accumulate({"col1","col2",..."coln"},#"Previous Step",(s,c)=>Table.TransformColumns(s, {c, each Text.TrimStart(_,"0")}))
Axel_hnk
4 years agoFrequent Visitor
Hi,
I guess this only works for a whole table.
But I need to replace the leading character for just some columns, not all.
Thx anyway.
Vijay_A_Verma
Most Valuable Professional
4 years agoNo, it will work only for selected columns. In the example above, I have selected only columns 2 to 5...I have left column1.
If you see the result, column 1 in 2nd entry has a leading 0 which is not replaced.