<?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: tmap remove leading zeros from a string in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306655#M78173</link>
    <description>Thanks a lot - that works just like intended.</description>
    <pubDate>Fri, 26 Apr 2013 18:47:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-04-26T18:47:28Z</dc:date>
    <item>
      <title>tmap remove leading zeros from a string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306653#M78171</link>
      <description>I have a customer table (customer number and custumer name). Most of the custumers are integer, but some of them have a "L" in front of them. The custumer number is therefore type string. The problem is that the "integer" custumers have leading zeros - for instance 0000113934 which I can remove if I make it integer, but thats not possible with the custumers starting with "L" for instance L1993493. 
&lt;BR /&gt;I tried in the tmap to make the expression: 
&lt;BR /&gt;StringHandling.LEFT(row1.Customer_number,1).equals("0")? 
&lt;BR /&gt;StringHandling.STR(Mathematical.INT(row1.Customer_number),50): row1.Customer_number 
&lt;BR /&gt;But then I get the error: 
&lt;BR /&gt; The method STR(char, int) in the type StringHandling is not applicable for the arguments (int, int) 
&lt;BR /&gt;I also tried to filter the custumer numbers starting with zero in tmap and then putting the filtered output through tconverttype to cast it to integer and then another tconverttype to cast it back to string, but then when I use tunite with the other output from tmap where the custumer numbers does not start with zero I cannot get it to connect to the tunite. 
&lt;BR /&gt;Any good ideas?</description>
      <pubDate>Fri, 26 Apr 2013 15:21:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306653#M78171</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-26T15:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: tmap remove leading zeros from a string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306654#M78172</link>
      <description>You can't unite two outputs from the same tMap. 
&lt;BR /&gt;Have you tried 
&lt;BR /&gt;StringHandling.LEFT(row1.Customer_number,1).equals("0")? 
&lt;BR /&gt;Integer.toString(Integer.parseInt(row1.Customer_number)): row1.Customer_number</description>
      <pubDate>Fri, 26 Apr 2013 15:40:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306654#M78172</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2013-04-26T15:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: tmap remove leading zeros from a string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306655#M78173</link>
      <description>Thanks a lot - that works just like intended.</description>
      <pubDate>Fri, 26 Apr 2013 18:47:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306655#M78173</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-26T18:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: tmap remove leading zeros from a string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306656#M78174</link>
      <description>My 2 cents even though janhess's solution worked for you 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; : I like regex for these sorts of things as it's usually a neater expression so I would use: 
&lt;BR /&gt;row1.Customer_number.replaceAll("^0*","")</description>
      <pubDate>Mon, 29 Apr 2013 00:46:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-remove-leading-zeros-from-a-string/m-p/2306656#M78174</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-04-29T00:46:48Z</dc:date>
    </item>
  </channel>
</rss>

