add leading zero

Reply
Yellow Belt

Re: add leading zero

at first glance it looks like there are just 3 rows which have bank_id's with less than 8 digits

Black Belt

Re: add leading zero

If the number is that small, I would recommend filtering out those values first.  Here are the steps you would need to add:

First, add a filter before the "String Operation" where we created the LPAD field1.png

 

2.png

 

Second, you need to apply the opposite filter so that you only include the three values that don't need 9 digits:3.png

 

4.png

 

(make sure that you change the setting to include rows that meet "any" of the rules

 

Third, you need to add a column to the bottom data table that matches the name you created earlier (LPAD in your case).  I used "Text_pad" in my sample.  It just needs to be the same name.5.png

 

 

Fourth, use "Set Column Value" to map the values from your bank_id field to the new field:6.png

 

 

Fifth, Append the two data tables:7.png

 

 

Then your output will look something like this:8.png

 

 


______________________________________________________________________________________________
“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 believe the card is correct now, problem I'm running into now is the data in this table has to be exported to a CSV, which is then dropping the leading zeroes.

Green Belt

Re: add leading zero

Are you opening the csv file in excel?  Excel drops the leading zeros.  Open the file in notepad or another text editor and you should see the leading zeros in your csv file.

Announcements
Looking for the latest Dojo Community solutions? Click on the "NEW SOLUTIONS' widget title or go to https://dojo.domo.com/solutions Click here!