<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Expression for padding zeros in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324693#M94366</link>
    <description>Hi 
&lt;BR /&gt;Ok, I get you now, you want to pad zero before the number if the length of string less than 14, try this expression: 
&lt;BR /&gt;String.format("%014d", Integer.parseInt(row1.provNumber)) 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
    <pubDate>Mon, 22 Aug 2011 14:25:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-08-22T14:25:14Z</dc:date>
    <item>
      <title>Expression for padding zeros</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324688#M94361</link>
      <description>Hi, 
&lt;BR /&gt;I am new to Talend, please help. I need help to create an expression in Expression builder with the following logic. 
&lt;BR /&gt;IL10.provNumber is a string value. I need to add zeros to the left of the string based the string value. Finally, the string should have 14 characters length. 
&lt;BR /&gt;If(IL10.provNumber.length ==5) { 
&lt;BR /&gt; IL10.providerNumber = '000000000' + IL10.provNumber ; // If string IL10.provNumber's length is 5 characters, add 9 zeros to make the 14 char string 
&lt;BR /&gt;}else if(IL10.provNumber.length ==4) { 
&lt;BR /&gt; IL10.providerNumber = '0000000000' + IL10.provNumber ; // If string IL10.provNumber's length is 4 characters, add 10 zeros to make the 14 char string 
&lt;BR /&gt;} 
&lt;BR /&gt;Thanks in advance for your help.</description>
      <pubDate>Sat, 16 Nov 2024 12:43:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324688#M94361</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for padding zeros</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324689#M94362</link>
      <description>Hi 
&lt;BR /&gt;Try 
&lt;BR /&gt;IL10.provNumber.length ==5?"000000000" + IL10.provNumber:"0000000000" + IL10.provNumber 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 22 Aug 2011 12:03:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324689#M94362</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-22T12:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for padding zeros</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324690#M94363</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi &lt;BR /&gt;Try &lt;BR /&gt;IL10.provNumber.length ==5?"000000000" + IL10.provNumber:"0000000000" + IL10.provNumber&lt;BR /&gt;Best regards&lt;BR /&gt;Shong&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi, 
&lt;BR /&gt;Thank you verymuch for your reply. Yes, it worked. How can i have an expression for the below requirement. 
&lt;BR /&gt;only if the provNumber.length &amp;lt; 6 
&lt;BR /&gt; pad zeros to make total length 14 characters 
&lt;BR /&gt;For Example., if provNumber = abcde, the o/p should be 000000000abcde 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Jagadish.</description>
      <pubDate>Mon, 22 Aug 2011 12:46:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324690#M94363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-22T12:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for padding zeros</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324691#M94364</link>
      <description>row1.provNumber.length &amp;lt; 6 ?"000000000"+row1.provNumber:row1.provNumber</description>
      <pubDate>Mon, 22 Aug 2011 13:19:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324691#M94364</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-22T13:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for padding zeros</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324692#M94365</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;row1.provNumber.length &amp;lt; 6 ?"000000000"+row1.provNumber:row1.provNumber&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi Shong, 
&lt;BR /&gt;Thank you. But the expression works only if the length is 5. 
&lt;BR /&gt;For example., if row1.provNumber="12345", the output would be 00000000012345. This is fine, got 14 chars length. 
&lt;BR /&gt;row1.provNumber.length &amp;lt; 6 ?"000000000"+row1.provNumber:row1.provNumber 
&lt;BR /&gt; 
&lt;BR /&gt;But If the length is 4, that is row1.provNumber="1234", the output would be 0000000001234. This output only 13 characters length. But the expected output is 00000000001234 which is of 14 characters length. 
&lt;BR /&gt;row1.provNumber.length &amp;lt; 6 ?"000000000"+row1.provNumber:row1.provNumber 
&lt;BR /&gt;Similarly for the other cases where the length is 3, 2, 1 and 0. Is this is possible with Expression builder ? 
&lt;BR /&gt; 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Jagadish.</description>
      <pubDate>Mon, 22 Aug 2011 14:02:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324692#M94365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-22T14:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Expression for padding zeros</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324693#M94366</link>
      <description>Hi 
&lt;BR /&gt;Ok, I get you now, you want to pad zero before the number if the length of string less than 14, try this expression: 
&lt;BR /&gt;String.format("%014d", Integer.parseInt(row1.provNumber)) 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 22 Aug 2011 14:25:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Expression-for-padding-zeros/m-p/2324693#M94366</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-08-22T14:25:14Z</dc:date>
    </item>
  </channel>
</rss>

