add leading zero

Reply
AS Black Belt
Black Belt

Re: add leading zero

Good hack. Nice!

Aaron
MajorDomo @ Merit Medical

**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
Yellow Belt

Re: add leading zero

So I've done the first part but where do I add the second string operation....see attachment

AS Black Belt
Black Belt

Re: add leading zero

Add a replace text tile next after the string operation.

Aaron
MajorDomo @ Merit Medical

**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
Yellow Belt

Re: add leading zero

so I have it as the attached where I first set my column type for bank_id to text which was decimal then run the string operation LPAD contains bank_id padded to length: 10 from side: left, then did the replace text LPAD with a space in the term to search for and replace with 0, but still isn't adding the leading zero....thanks for all the help so far appreciate it.

Black Belt

Re: add leading zero

can you share a screen shot of the settings for each step?  


______________________________________________________________________________________________
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
______________________________________________________________________________________________
Yellow Belt

Re: add leading zero

images attached...thanks again

Black Belt

Re: add leading zero

From looking at your first post, I think you should change the length to 9.

 

From my understanding, you are getting a value of 071000013 but Domo is dropping the leading zero to be just 71000013.  

21.png

 


______________________________________________________________________________________________
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
______________________________________________________________________________________________
Black Belt

Re: add leading zero

Just to confirm, the field that should have the 9 digits will be whatever you choose to name the new column in the settings for that step (in your screenshot `LPAD`)

 

 


______________________________________________________________________________________________
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
______________________________________________________________________________________________
Yellow Belt

Re: add leading zero

so I changed the length to 9 but am seeing that all of the rows won't have a bank_id with 9 digits, ex. one of the id's is 123456 which is correct but the LPAD is adding 000 before it

 

The rows which are 8 digits and are missing the leading zero are correct now

Black Belt

Re: add leading zero

Correct.  Using the PAD function will force all of the fields to have the specified number of characters.  Is there another field in your data set that would indicate that the bank_id should not have 9 digits? You could filter those out before using the Pad function and the join the two back together.


______________________________________________________________________________________________
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
______________________________________________________________________________________________
Announcements
Looking for the latest Community solutions? Please visit our accepted solutions board here!