<?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: How to Perform Cumulative in Talend in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-Perform-Cumulative-in-Talend/m-p/2337902#M106196</link>
    <description>Thanks a lot. Very clearly explained.</description>
    <pubDate>Mon, 11 Sep 2017 07:49:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-09-11T07:49:30Z</dc:date>
    <item>
      <title>How to Perform Cumulative in Talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Perform-Cumulative-in-Talend/m-p/2337900#M106194</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to Talend and trying to explore on talend with more use cases. I have a below requirement.&lt;/P&gt;
&lt;P&gt;Could any one please suggest on this. I have tried with tmemorize and tmap components and unable to reach the requirement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also is it possible to compare previous record with current record in talend as we do in Informatica.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I/P:&lt;/P&gt;
&lt;P&gt;ID;DEPTNO;SAL&lt;/P&gt;
&lt;P&gt;111;10;200&lt;/P&gt;
&lt;P&gt;112;20;300&lt;/P&gt;
&lt;P&gt;113;10;400&lt;/P&gt;
&lt;P&gt;114;30;500&lt;/P&gt;
&lt;P&gt;115;20;500&lt;/P&gt;
&lt;P&gt;116;20;200&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;O/P:&lt;/P&gt;
&lt;P&gt;ID;DEPTNO;SAL&lt;/P&gt;
&lt;P&gt;111;10;200;200&lt;/P&gt;
&lt;P&gt;113;10;400;600&lt;/P&gt;
&lt;P&gt;112;20;300;300&lt;/P&gt;
&lt;P&gt;115;20;500;800&lt;/P&gt;
&lt;P&gt;116;20;200;1000&lt;/P&gt;
&lt;P&gt;114;30;500;500&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in Advance..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;venkat.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Sep 2017 08:13:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Perform-Cumulative-in-Talend/m-p/2337900#M106194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-10T08:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Cumulative in Talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Perform-Cumulative-in-Talend/m-p/2337901#M106195</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;Here is a solution:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 711px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LwaI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135624iEA981E91113DAFA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LwaI.png" alt="0683p000009LwaI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;tSortRow to order input by detpno&lt;/P&gt; 
&lt;P&gt;tJavaRow to compute cumulative values using global variable to store intermediate result:&lt;/P&gt; 
&lt;PRE&gt;//Code generated according to input schema and output schema
output_row.id = input_row.id;
output_row.deptno = input_row.deptno;
output_row.sal = input_row.sal;

if((Integer)globalMap.get(Integer.toString(row32.deptno)) != null){
	output_row.cumul = (Integer)globalMap.get(Integer.toString(row32.deptno)) + input_row.sal;
	globalMap.put(Integer.toString(input_row.deptno), output_row.cumul);
}
else{
	output_row.cumul = input_row.sal;
	globalMap.put(Integer.toString(input_row.deptno), input_row.sal);
}&lt;/PRE&gt; 
&lt;P&gt;The result:&lt;/P&gt; 
&lt;PRE&gt;Starting job test at 11:06 10/09/2017.

[statistics] connecting to socket on port 3455
[statistics] connected
111|10|200|200
113|10|400|600
112|20|300|300
115|20|500|800
116|20|200|1000
114|30|500|500
[statistics] disconnected
Job test ended at 11:06 10/09/2017. [exit code=0]&lt;/PRE&gt; 
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Sep 2017 10:10:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Perform-Cumulative-in-Talend/m-p/2337901#M106195</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-09-10T10:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Cumulative in Talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Perform-Cumulative-in-Talend/m-p/2337902#M106196</link>
      <description>Thanks a lot. Very clearly explained.</description>
      <pubDate>Mon, 11 Sep 2017 07:49:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Perform-Cumulative-in-Talend/m-p/2337902#M106196</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-11T07:49:30Z</dc:date>
    </item>
  </channel>
</rss>

