<?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: Retain value of sequence generator in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328725#M97985</link>
    <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOOpAAO"&gt;@Prabhat&lt;/A&gt;,please find the below way.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LxU6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134453iE71AC0382336F56C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LxU6.png" alt="0683p000009LxU6.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LxeZ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137526i150B355727B8A4DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LxeZ.png" alt="0683p000009LxeZ.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 05:55:12 GMT</pubDate>
    <dc:creator>manodwhb</dc:creator>
    <dc:date>2018-05-16T05:55:12Z</dc:date>
    <item>
      <title>Retain value of sequence generator</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328723#M97983</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have a sequence for one of the column and it should start the sequence from where the last run stopped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example if 10 was generated by sequence for first run , for second run it should start with 11.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the first half , to generate the sequence using numeric.sequence("s1",1,1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you suggest how can i implement the second part , i went through the forum but couldn't find the solution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Prabhat&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 00:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328723#M97983</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-16T00:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Retain value of sequence generator</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328724#M97984</link>
      <description>Store the value of the current run into (1) a file or (2) a database table or (3) a context variable and recreate your context file.&lt;BR /&gt;Then when the next run starts, get the value and push it to a global variable (for 1 and 2) and use it to set the sequence value like this: numeric.sequence("s1", (Integer)globalMap.get("yourVariable ", 1) or numeric.sequence("s1", context.yourVariable, 1) in the case of a context variable.</description>
      <pubDate>Wed, 16 May 2018 05:21:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328724#M97984</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-05-16T05:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Retain value of sequence generator</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328725#M97985</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOOpAAO"&gt;@Prabhat&lt;/A&gt;,please find the below way.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LxU6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134453iE71AC0382336F56C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LxU6.png" alt="0683p000009LxU6.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LxeZ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137526i150B355727B8A4DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LxeZ.png" alt="0683p000009LxeZ.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 05:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328725#M97985</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-05-16T05:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Retain value of sequence generator</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328726#M97986</link>
      <description>&lt;P&gt;This is just a kind of visual representation of what I wrote before.&lt;/P&gt;&lt;P&gt;Nothing really new in that.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 08:52:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328726#M97986</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-05-16T08:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Retain value of sequence generator</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328727#M97987</link>
      <description>&lt;P&gt;Thanks TRF for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not looking to store the values in file or database. Can you please tell me more about the 3rd way where we are storing the current value in context variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Prabhat&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 18:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328727#M97987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-16T18:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Retain value of sequence generator</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328728#M97988</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOOpAAO"&gt;@Prabhat&lt;/A&gt;,without loading to file or DB it is not possiable as per my understanding.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LKj7AAG"&gt;@TRF&lt;/A&gt;,can you explain the way without loading into file or DB?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 07:50:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328728#M97988</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-05-17T07:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Retain value of sequence generator</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328729#M97989</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOOpAAO"&gt;@Prabhat&lt;/A&gt;, sorry for the delay, here the full solution using a context file.&lt;/P&gt; 
&lt;P&gt;For the sample, the job design looks like this:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 649px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ly0z.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153900iCD676B6CE728FE9A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ly0z.png" alt="0683p000009Ly0z.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;How it works:&lt;/P&gt; 
&lt;P&gt;- the context is stored in a properties file outside from the&amp;nbsp;job package and loaded at runtime using the implicit tContextLoad functionality (Job properties, Extra, untick the "Use project properties" option, tick "Implicit tContextLoad, choose "From the file" and enter your filename which is&amp;nbsp;"C:/Users/offic/Desktop/TestTalend/contextDump.csv" in my case, choose ";" or any thing else as the field separator)&lt;/P&gt; 
&lt;P&gt;- here is what my contextDump.csv file looks like:&lt;/P&gt; 
&lt;PRE&gt;hasmore;
sample;100
test;0&lt;/PRE&gt; 
&lt;P&gt;- the context variable used to store the current value is called "sample" with an initial value of 0&lt;/P&gt; 
&lt;P&gt;- when the job starts, the tJava component print its value&amp;nbsp;on the console (see the end)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;- then we go to the tFixedFlowInput component which is used to compute the new value for the sample context variable. As the variable must be a String for the nex component (tContextLoad), we have a double conversion to convert the value to an Integer, add 100 to the current value and convert the result back to a String:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 840px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ly19.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134555iEB4F919BB7935F42/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ly19.png" alt="0683p000009Ly19.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;- tContextLoad is used to modify the value of the context variables&lt;/P&gt; 
&lt;P&gt;- tContextDump / tFileOutputDelimited write these variables with their value into the context file used when the job starts (&lt;SPAN&gt;C:/Users/offic/Desktop/TestTalend/contextDump.csv)&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;- finally, tJava print&amp;nbsp;its&amp;nbsp;new value&amp;nbsp;on the console:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;Démarrage du job test a 14:20 19/05/2018.
[statistics] connecting to socket on port 3884
[statistics] connected
Initial value:100
[statistics] disconnected
Job test terminé à 14:20 19/05/2018. [Code sortie=0]&lt;/PRE&gt; 
&lt;P&gt;Each time the job starts, the value from the previous run is taken from the context file.&lt;/P&gt; 
&lt;P&gt;That's all.&lt;/P&gt;</description>
      <pubDate>Sat, 19 May 2018 13:43:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328729#M97989</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-05-19T13:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Retain value of sequence generator</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328730#M97990</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOOpAAO" target="_blank"&gt;@Prabhat&lt;/A&gt;&lt;SPAN&gt;, did this help you?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If so, thank's to mark this case as solved (Kudos also accepted).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 09:33:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retain-value-of-sequence-generator/m-p/2328730#M97990</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-05-21T09:33:44Z</dc:date>
    </item>
  </channel>
</rss>

