<?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 [Help] Sequence Number from different file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311334#M82386</link>
    <description>&lt;P&gt;Hi forum,&lt;BR /&gt;im very confused when i tried to make sequence number from some file. For example i have 2 files with same attribute but different name. i called first file "file xxx" and the second is "file zzz". &lt;BR /&gt;in file xxx i have attribut :&lt;BR /&gt;code|name&lt;BR /&gt;101|kaya&lt;BR /&gt;102|jennifer&lt;BR /&gt;103|shakira&lt;BR /&gt;&lt;BR /&gt;and then in file zzz i have attribut :&lt;BR /&gt;&lt;BR /&gt;code|name&lt;BR /&gt;101|kaya&lt;BR /&gt;102|jennifer&lt;BR /&gt;104|raisa&lt;BR /&gt;&lt;BR /&gt;i want to make output :&lt;BR /&gt;in file xxx&lt;BR /&gt;id|code|name&lt;BR /&gt;1|101|kaya&lt;BR /&gt;2|102|jennifer&lt;BR /&gt;3|103|shakira&lt;BR /&gt;&lt;BR /&gt;in file zzz&lt;BR /&gt;id|code|name&lt;BR /&gt;1|101|kaya&lt;BR /&gt;2|102|jennifer&lt;BR /&gt;4|104|raisa&lt;BR /&gt;&lt;BR /&gt;i tried using tAggregateRow and using sequence number ("s1,1,1") to group by code but in different file, sequence number always add.&lt;BR /&gt;my wrong output :&lt;BR /&gt;&lt;BR /&gt;in file xxx&lt;BR /&gt;id|code|name&lt;BR /&gt;1|101|kaya&lt;BR /&gt;2|102|jennifer&lt;BR /&gt;3|103|shakira&lt;BR /&gt;&lt;BR /&gt;in file zzz&lt;BR /&gt;id|code|name&lt;BR /&gt;4|101|kaya&lt;BR /&gt;5|102|jennifer&lt;BR /&gt;6|104|raisa&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2015 04:01:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-11-17T04:01:28Z</dc:date>
    <item>
      <title>[Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311334#M82386</link>
      <description>&lt;P&gt;Hi forum,&lt;BR /&gt;im very confused when i tried to make sequence number from some file. For example i have 2 files with same attribute but different name. i called first file "file xxx" and the second is "file zzz". &lt;BR /&gt;in file xxx i have attribut :&lt;BR /&gt;code|name&lt;BR /&gt;101|kaya&lt;BR /&gt;102|jennifer&lt;BR /&gt;103|shakira&lt;BR /&gt;&lt;BR /&gt;and then in file zzz i have attribut :&lt;BR /&gt;&lt;BR /&gt;code|name&lt;BR /&gt;101|kaya&lt;BR /&gt;102|jennifer&lt;BR /&gt;104|raisa&lt;BR /&gt;&lt;BR /&gt;i want to make output :&lt;BR /&gt;in file xxx&lt;BR /&gt;id|code|name&lt;BR /&gt;1|101|kaya&lt;BR /&gt;2|102|jennifer&lt;BR /&gt;3|103|shakira&lt;BR /&gt;&lt;BR /&gt;in file zzz&lt;BR /&gt;id|code|name&lt;BR /&gt;1|101|kaya&lt;BR /&gt;2|102|jennifer&lt;BR /&gt;4|104|raisa&lt;BR /&gt;&lt;BR /&gt;i tried using tAggregateRow and using sequence number ("s1,1,1") to group by code but in different file, sequence number always add.&lt;BR /&gt;my wrong output :&lt;BR /&gt;&lt;BR /&gt;in file xxx&lt;BR /&gt;id|code|name&lt;BR /&gt;1|101|kaya&lt;BR /&gt;2|102|jennifer&lt;BR /&gt;3|103|shakira&lt;BR /&gt;&lt;BR /&gt;in file zzz&lt;BR /&gt;id|code|name&lt;BR /&gt;4|101|kaya&lt;BR /&gt;5|102|jennifer&lt;BR /&gt;6|104|raisa&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 04:01:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311334#M82386</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-17T04:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311335#M82387</link>
      <description>Hi&lt;BR /&gt;You need to set a different sequence name for each file instead of a constant "s1", if you are using tFileList to iterate each file, you can set the sequence name with the global variable which counts the current file, for example:&amp;nbsp;&lt;BR /&gt;Numeric.sequence(((String)globalMap.get("tFileList_1_CURRENT_FILE")),1,1)</description>
      <pubDate>Tue, 17 Nov 2015 10:27:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311335#M82387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-17T10:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311336#M82388</link>
      <description>2 sequences won't work for this I don't think Shong. It looks like thy want to tie the number to the code in both files. So if code 103 is awarded a 1 in one file, it will also have a 1 in the other file. The easiest way I can think of doing this is to do the following.... 
&lt;BR /&gt; 
&lt;BR /&gt;1) Create a routine. 
&lt;BR /&gt;2) Create a HashMap and an integer to keep track of the sequence in the routine. 
&lt;BR /&gt;3) For each code that is sent to the routine, check the HashMap to see if it exists. If it does not, add 1 to the sequence and store the current value of the sequence in the HashMap using the code as the key to the value. If it does exist, use the code to retrieve the value stored. 
&lt;BR /&gt;This will return the same sequence values between the files if the codes are the same.</description>
      <pubDate>Tue, 17 Nov 2015 10:46:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311336#M82388</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-17T10:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311337#M82389</link>
      <description>No 103 gets 3. 104 gets 4. The sequence is based on the code field - 100.</description>
      <pubDate>Tue, 17 Nov 2015 13:29:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311337#M82389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-17T13:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311338#M82390</link>
      <description>I took it that that was a oversight of the example JanHess2. If not, then simply subtracting 100 would do.</description>
      <pubDate>Tue, 17 Nov 2015 14:56:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311338#M82390</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-17T14:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311339#M82391</link>
      <description>Hi shong i think it doesnt work, second sequence can start again from "1". I want sequence number based on the first sequence. 
&lt;BR /&gt; 
&lt;BR /&gt;for 
&lt;B&gt;rhall_2.0, &lt;/B&gt;can you give me an example code in routines? thank you for your reply</description>
      <pubDate>Wed, 18 Nov 2015 02:11:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311339#M82391</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-18T02:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311340#M82392</link>
      <description>Hi erbi &amp;nbsp;
&lt;BR /&gt;Sorry, I read your question so quickly before, I think i understand your request know, as rhall_2.0 suggested, you need to hard code in a routine to return the sequence id based on the code field.&amp;nbsp;</description>
      <pubDate>Wed, 18 Nov 2015 02:37:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311340#M82392</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-18T02:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311341#M82393</link>
      <description>Hello,
&lt;BR /&gt;As 
&lt;B&gt;rhall_2.0 &lt;/B&gt;said
&lt;B&gt;, &lt;/B&gt;you can create a routine. 
&lt;BR /&gt;An example of routine can be this one I think :
&lt;BR /&gt;
&lt;PRE&gt;package routines;&lt;BR /&gt;&lt;BR /&gt;import java.util.HashMap;&lt;BR /&gt;import java.util.Map;&lt;BR /&gt;&lt;BR /&gt;public class Sequences {&lt;BR /&gt;	public static Map&amp;lt;Integer,Integer&amp;gt; map = new HashMap&amp;lt;Integer, Integer&amp;gt;();&lt;BR /&gt;	public static Integer value = 0;&lt;BR /&gt;	&lt;BR /&gt;    public static Integer getId(Integer code) {&lt;BR /&gt;        if (! map.containsKey(code)){&lt;BR /&gt;        	value = value +1;&lt;BR /&gt;        	map.put(code, value);&lt;BR /&gt;        }&lt;BR /&gt;        return map.get(code);&lt;BR /&gt;    }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;When your routine had been created just call it in your tMap (the call is in this case : Sequences.getId(row1.code) )
&lt;BR /&gt;I hope it will help you.</description>
      <pubDate>Wed, 18 Nov 2015 08:58:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311341#M82393</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-18T08:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311342#M82394</link>
      <description>Yeah, that would do it tdz (.......damn it, you got there first! 
&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; )</description>
      <pubDate>Wed, 18 Nov 2015 09:09:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311342#M82394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-18T09:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311343#M82395</link>
      <description>&lt;BLOCKQUOTE&gt;
  rhall_2.0 wrote: 
 &lt;BR /&gt;Yeah, that would do it tdz (.......damn it, you got there first! 
 &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; ) 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Thank you and sorry 
&lt;B&gt;rhall_2.0&lt;/B&gt;, next time I will let you give the solution first (moreover because it's your idea) 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt;&amp;nbsp;</description>
      <pubDate>Wed, 18 Nov 2015 09:26:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311343#M82395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-18T09:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311344#M82396</link>
      <description>hei tdz and rhall, in Sequences.getId(row1.code), row1.code can replace by what? thank you</description>
      <pubDate>Tue, 24 Nov 2015 06:29:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311344#M82396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-24T06:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: [Help] Sequence Number from different file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311345#M82397</link>
      <description>"row1.code" should be replaced by whatever you want to be the key to your sequence number.</description>
      <pubDate>Tue, 24 Nov 2015 09:22:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Sequence-Number-from-different-file/m-p/2311345#M82397</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-24T09:22:37Z</dc:date>
    </item>
  </channel>
</rss>

