trim 0 values from beginning

asked 2022-06-08T09:30:51.313+00:00
arkiboys 7,861 Reputation points

How is it possible to remove the beginning 0 values from a string in dataflow?
for example:
43255
5656poppp
00005443
008787
...

It should give:
43255
5656poppp
5443
8787
...

Thank you

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
6,256 questions
No comments
{count} votes

Accepted answer
  1. answered 2022-06-08T14:53:58.077+00:00
    Subashri Vasudevan 4,221 Reputation points

    Hi @arkiboys ,

    we can use ltrim(stringcolumnname,'0')

    Please check the below image, on right hand side you see my original values and left hand side trimmed values. Hope it helps. Let us know how it goes,

    209526-screenshot-2022-06-08-at-82155-pm.png

    Thanks

    No comments

1 additional answer

Sort by: Most helpful
  1. answered 2022-06-08T10:44:19.21+00:00
    Samy Abdul 2,991 Reputation points

    Hi @arkiboys , using length function and substring function should get you there, something along the lines below for example:

    @substring('helloworld',0,sub(length('helloworld'),3)) Thanks