<?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 adding sequence number in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351689#M118284</link>
    <description>That doesn't really work 
&lt;A href="https://community.qlik.com/s/profile/0053p000007LKj7AAG"&gt;@TRF&lt;/A&gt;. That solution requires a different expression depending on the length of the number returned by the sequence.</description>
    <pubDate>Fri, 22 Sep 2017 14:03:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-09-22T14:03:49Z</dc:date>
    <item>
      <title>Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351680#M118275</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can i please request help on how to achive the below result using tmap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;A134&lt;/P&gt;&lt;P&gt;A134&lt;/P&gt;&lt;P&gt;A134&lt;/P&gt;&lt;P&gt;B235&lt;/P&gt;&lt;P&gt;B235&lt;/P&gt;&lt;P&gt;C129&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output&lt;/P&gt;&lt;P&gt;A134-01&lt;/P&gt;&lt;P&gt;A134-02&lt;/P&gt;&lt;P&gt;A134-03&lt;/P&gt;&lt;P&gt;B235-01&lt;/P&gt;&lt;P&gt;B235-02&lt;/P&gt;&lt;P&gt;C129-01&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 14:16:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351680#M118275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-21T14:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351681#M118276</link>
      <description>This one is quite straight forward. In your tmap use a tMap variable (from the section in between the input and output). In that variable put the following code....&lt;BR /&gt;&lt;BR /&gt;Numeric.sequence(row.input, 1, 1)&lt;BR /&gt;&lt;BR /&gt;I've used row. input to represent your input column. What this does is create a sequence for each different input.&lt;BR /&gt;&lt;BR /&gt;Given it a go and let us know if it works for you</description>
      <pubDate>Thu, 21 Sep 2017 14:46:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351681#M118276</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-21T14:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351682#M118277</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;thanks, sorry i am new to talend, is it possible to give step by step instruction or screenshot of tmap configuration, i get this error&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.jpg" style="width: 874px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LqpB.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144509i0360F254FDC2488F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LqpB.jpg" alt="0683p000009LqpB.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 16:13:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351682#M118277</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-21T16:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351683#M118278</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The error is probably due to the datatype of the variable which should be an integer to receive the result of Numeric.sequence.&lt;/P&gt; 
&lt;P&gt;However, as you expect to keep leading 0 on indices, keep the var datatype as String and replace the formula by this one:&lt;/P&gt; 
&lt;PRE&gt;("100" + Numeric.sequence(row1.input, 1, 1)).substring(2) &lt;/PRE&gt; 
&lt;P&gt;Here is the tMap configuration:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lqpa.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147025i93A38590629A2D8F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lqpa.png" alt="0683p000009Lqpa.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;And here is the result:&lt;/P&gt; 
&lt;PRE&gt;Starting job test at 18:13 21/09/2017.

[statistics] connecting to socket on port 3834
[statistics] connected
A134-01
A134-02
A134-03
B235-01
B235-02
C129-01
[statistics] disconnected
Job test ended at 18:13 21/09/2017. [exit code=0]&lt;/PRE&gt; 
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 17:19:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351683#M118278</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-09-21T17:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351684#M118279</link>
      <description>&lt;P&gt;Perfect, thanks worked like charm.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 10:35:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351684#M118279</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T10:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351685#M118280</link>
      <description>&lt;P&gt;one small problem how do we deal with result that go beyond sequence 9&lt;/P&gt;
&lt;P&gt;for example below&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;right now i am getting result as &amp;nbsp;below.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-01&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-02&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-03&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-04&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-05&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-06&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-07&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-08&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-09&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-010&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-011&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and i want output after 9 should be like&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-10&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-11&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;instead of&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-010&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A134-011&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thnaks for yoru help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 11:35:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351685#M118280</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T11:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351686#M118281</link>
      <description>&lt;P&gt;What happens if the number gets to 3 digits? I take it you don't want it truncated?&lt;/P&gt; 
&lt;P&gt;This method will help. Create a routine and add this method to the routine. Then you can use it in place of the code you are currently using.&lt;/P&gt; 
&lt;PRE&gt;   public static String returnZeroPrePaddedNumber(int length, String number){
    	String returnVal = number;
    	
    	while(returnVal!=null&amp;amp;&amp;amp;returnVal.length()&amp;lt;length){
    		returnVal = "0"+returnVal; 
    	}
    	
    	return returnVal;
    }&lt;/PRE&gt; 
&lt;P&gt;As an example of how to use it, at the moment you are using this.....&lt;/P&gt; 
&lt;PRE&gt;("100" + Numeric.sequence(row1.input, 1, 1)).substring(2) &lt;/PRE&gt; 
&lt;P&gt;If you create a routine called "MyUtils", and add the method I gave you to it, you would use this code....&lt;/P&gt; 
&lt;PRE&gt;routines.MyUtils.returnZeroPrePaddedNumber(2, ("" + Numeric.sequence(row1.input, 1, 1))) &lt;/PRE&gt; 
&lt;P&gt;This code takes an integer parameter which tells it how many digits are required as a minimum. The second parameter is a number as a String. If that number is less than the minimum number of digits, it adds 0s to the beginning until the minimum is reached. If the minimum is matched by the number (or the number has more digits), nothing happens to it.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 12:32:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351686#M118281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T12:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351687#M118282</link>
      <description>&lt;P&gt;Or just replace the expression&amp;nbsp;by this one:&lt;/P&gt;
&lt;PRE&gt;(""+(100 + Numeric.sequence(row1.input, 1, 1))).substring(1) &lt;/PRE&gt;
&lt;P&gt;And if you want 3 leading 0, replace 100 by 1000 and so on.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 13:30:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351687#M118282</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-09-22T13:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351688#M118283</link>
      <description>&lt;P&gt;thank you&amp;nbsp; all&amp;nbsp;for help.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 13:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351688#M118283</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T13:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351689#M118284</link>
      <description>That doesn't really work 
&lt;A href="https://community.qlik.com/s/profile/0053p000007LKj7AAG"&gt;@TRF&lt;/A&gt;. That solution requires a different expression depending on the length of the number returned by the sequence.</description>
      <pubDate>Fri, 22 Sep 2017 14:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351689#M118284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T14:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351690#M118285</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;, you're right, you have to know the max expected length to decide if you need to add 10, 100, 1000 and so on.&lt;/P&gt; 
&lt;P&gt;From my point of view, this is the same when you use MyUtils.returnZeroPrePaddedNumber as you must decide how many leading 0 are expected.&lt;/P&gt; 
&lt;P&gt;The advantage of this routine is that there is no truncation when the input value is too large (but in that case the result is not exactly what is expected as soon as a fixed length is required).&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 14:14:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351690#M118285</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-09-22T14:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap adding sequence number</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351691#M118286</link>
      <description>&lt;P&gt;There is no perfect solution&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LKj7AAG"&gt;@TRF&lt;/A&gt;&amp;nbsp;given the information we have. I just tried to make it a bit more flexible by setting a minimum length. The assumption being that numbers will not need&amp;nbsp;to be truncated, but that you may always want at least 2 digits, for example.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 15:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-adding-sequence-number/m-p/2351691#M118286</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T15:10:37Z</dc:date>
    </item>
  </channel>
</rss>

