<?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: cumulative sum values group by column in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344960#M112551</link>
    <description>i have a requirement like 
&lt;BR /&gt;zoneid loss id(pk) month 
&lt;BR /&gt;z1 10 1 jan 
&lt;BR /&gt;z1 20 3 feb 
&lt;BR /&gt;z1 30 5 march 
&lt;BR /&gt;z2 100 2 jan 
&lt;BR /&gt;z2 200 4 feb 
&lt;BR /&gt;z2 300 6 march 
&lt;BR /&gt;now i need cumalative output like 
&lt;BR /&gt;zoneid loss id(pk) month cumalativeloss 
&lt;BR /&gt;z1 10 1 jan 10 
&lt;BR /&gt;z1 20 3 feb 30 
&lt;BR /&gt;z1 30 5 march 60 
&lt;BR /&gt;z2 100 2 jan 100 
&lt;BR /&gt;z2 200 4 feb 300 
&lt;BR /&gt;z2 300 6 march 600 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;raviteja</description>
    <pubDate>Tue, 24 Dec 2013 11:02:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-12-24T11:02:29Z</dc:date>
    <item>
      <title>cumulative sum values group by column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344957#M112548</link>
      <description>Hi All,&lt;BR /&gt;i am newbie to Talend&lt;BR /&gt;i am not able to find out Cumulative sum values. Any idea how to get output?&lt;BR /&gt;Example data is:&lt;BR /&gt;we have one input like&lt;BR /&gt;No|name|salary|Job&lt;BR /&gt;1|aaa|3000|Manager&lt;BR /&gt;2|bbb|4000|sales&lt;BR /&gt;3|sven|2500|marketing&lt;BR /&gt;4|joe|3250|Manager&lt;BR /&gt;5|jim|2340|sales&lt;BR /&gt;6|karl|1500|Manager&lt;BR /&gt;7|mac|3000|sales&lt;BR /&gt;we have another input as&lt;BR /&gt;Job|cum_salary&lt;BR /&gt;Manager|45000&lt;BR /&gt;sales|0&lt;BR /&gt;marketing|25000&lt;BR /&gt;&lt;BR /&gt;output like&lt;BR /&gt;No|name|salary|Job|Cum_salary&lt;BR /&gt;1|aaa|3000|Manager|48000&lt;BR /&gt;4|joe|3250|Manager|51250&lt;BR /&gt;6|karl|1500|Manager|52750&lt;BR /&gt;2|bbb|4000|sales|4000&lt;BR /&gt;5|jim|2340|sales|6340&lt;BR /&gt;7|mac|3000|sales|9340&lt;BR /&gt;3|sven|2500|marketing|27500&lt;BR /&gt;Ex: &lt;BR /&gt;Job:Manager, &lt;BR /&gt;First row cum_salary is 45000 + 3000 = 48000&lt;BR /&gt;second row cum_salary is 48000 + 3250 = 51250&lt;BR /&gt;third row cum_salary is 51250 + 1500 = 52750&lt;BR /&gt;Job:sales,&lt;BR /&gt;First row cum_salary is 0 + 4000 = 4000&lt;BR /&gt;second row cum_salary is 4000 + 2340 = 6340&lt;BR /&gt;third row cum_salary is 6340 + 3000 = 9340&lt;BR /&gt;Job:Marketing&lt;BR /&gt;First row cum_salary is 25000 + 2500 = 27500&lt;BR /&gt;like that....... &lt;BR /&gt;we have cumulative salary based on Job &lt;BR /&gt;and like incremental loading &lt;BR /&gt;Can you please suggest on this.&lt;BR /&gt;cheers,&lt;BR /&gt;Raju</description>
      <pubDate>Tue, 30 Jul 2013 07:44:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344957#M112548</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-30T07:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum values group by column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344958#M112549</link>
      <description>I think simplest is to read your cum_salary table and store the cum_salary for each job in a globalMap variable:&lt;BR /&gt;tInput --&amp;gt; tJavaRow  =&amp;gt;  globalMap.put(input_row.Job,input_row.cum_salary)&lt;BR /&gt;Then read your individuals table and add the salary:&lt;BR /&gt;tInput --&amp;gt; tJavaRow&lt;BR /&gt;&lt;PRE&gt;Integer cum_salary = (Integer)globalMap.get(input_row.Job) + input_row.salary;&lt;BR /&gt;globalMap.put(input_row.Job,cum_salary);&lt;BR /&gt;output_row.No = input_row.No;&lt;BR /&gt;output_row.name = input_row.name;&lt;BR /&gt;output_row.salary = input_row.salary;&lt;BR /&gt;output_row.Job = input_row.Job;&lt;BR /&gt;output_row.Cum_salary= cum_salary;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jul 2013 10:42:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344958#M112549</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-07-31T10:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum values group by column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344959#M112550</link>
      <description>Hi 
&lt;BR /&gt;Do a left outer join on tMap base on the Job column, here I create a demo job to show you how to achieve this request, please see my screenshots for details. 
&lt;BR /&gt;tFixedFlowInput_1: 
&lt;BR /&gt;1|aaa|3000|Manager 
&lt;BR /&gt;2|bbb|4000|sales 
&lt;BR /&gt;3|sven|2500|marketing 
&lt;BR /&gt;4|joe|3250|Manager 
&lt;BR /&gt;5|jim|2340|sales 
&lt;BR /&gt;6|karl|1500|Manager 
&lt;BR /&gt;7|mac|3000|sales 
&lt;BR /&gt;tFixedFlowInput_2: 
&lt;BR /&gt;Manager|45000 
&lt;BR /&gt;sales|0 
&lt;BR /&gt;marketing|25000 
&lt;BR /&gt; 
&lt;BR /&gt;Cum_salary expression of out1 table on tMap: 
&lt;BR /&gt; 
&lt;PRE&gt;(Integer)globalMap.get(""+row1.Job+"")==null?row1.salary+row2.Cum_salary:(Integer)globalMap.get(""+row1.Job+"")+row1.salary&lt;/PRE&gt; 
&lt;BR /&gt;// if (Integer)globalMap.get(""+row1.Job+"")==null, means it is the first row for one Job type. 
&lt;BR /&gt;Result: 
&lt;BR /&gt; 
&lt;PRE&gt;Starting job jobA at 19:16 31/07/2013.&lt;BR /&gt;&lt;BR /&gt; connecting to socket on port 3791&lt;BR /&gt; connected&lt;BR /&gt;.--+----+------+---------+----------.&lt;BR /&gt;|             tLogRow_1             |&lt;BR /&gt;|=-+----+------+---------+---------=|&lt;BR /&gt;|No|name|salary|Job      |Cum_salary|&lt;BR /&gt;|=-+----+------+---------+---------=|&lt;BR /&gt;|1 |aaa |3000  |Manager  |48000     |&lt;BR /&gt;|2 |bbb |4000  |sales    |4000      |&lt;BR /&gt;|3 |sven|2500  |marketing|27500     |&lt;BR /&gt;|4 |joe |3250  |Manager  |51250     |&lt;BR /&gt;|5 |jim |2340  |sales    |6340      |&lt;BR /&gt;|6 |karl|1500  |Manager  |52750     |&lt;BR /&gt;|7 |mac |3000  |sales    |9340      |&lt;BR /&gt;'--+----+------+---------+----------'&lt;BR /&gt; disconnected&lt;BR /&gt;Job jobA ended at 19:16 31/07/2013. &lt;/PRE&gt; 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEqD.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154365i00724B354BAB02B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEqD.png" alt="0683p000009MEqD.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEgE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129633iA2363B77993BEDC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEgE.png" alt="0683p000009MEgE.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEr0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150719iA6B100B260C1ED72/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEr0.png" alt="0683p000009MEr0.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEr5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138066i84ED51DE21691DC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEr5.png" alt="0683p000009MEr5.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 31 Jul 2013 12:24:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344959#M112550</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-31T12:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum values group by column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344960#M112551</link>
      <description>i have a requirement like 
&lt;BR /&gt;zoneid loss id(pk) month 
&lt;BR /&gt;z1 10 1 jan 
&lt;BR /&gt;z1 20 3 feb 
&lt;BR /&gt;z1 30 5 march 
&lt;BR /&gt;z2 100 2 jan 
&lt;BR /&gt;z2 200 4 feb 
&lt;BR /&gt;z2 300 6 march 
&lt;BR /&gt;now i need cumalative output like 
&lt;BR /&gt;zoneid loss id(pk) month cumalativeloss 
&lt;BR /&gt;z1 10 1 jan 10 
&lt;BR /&gt;z1 20 3 feb 30 
&lt;BR /&gt;z1 30 5 march 60 
&lt;BR /&gt;z2 100 2 jan 100 
&lt;BR /&gt;z2 200 4 feb 300 
&lt;BR /&gt;z2 300 6 march 600 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;raviteja</description>
      <pubDate>Tue, 24 Dec 2013 11:02:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344960#M112551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-24T11:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum values group by column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344961#M112552</link>
      <description>Hi,
&lt;BR /&gt;Any update on the above give problem cause i m having the same issue as mentioned by 
&lt;B&gt;raviteja.talend&lt;/B&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Regards,&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;Ojas&lt;BR /&gt;&lt;/B&gt;</description>
      <pubDate>Thu, 08 Jan 2015 07:53:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344961#M112552</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2015-01-08T07:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum values group by column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344962#M112553</link>
      <description>Hi 
&lt;BR /&gt;@ 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;raviteja and Ojas, the tMemorizeRow component can fit your need, refer to the component manual and learn this component.&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;Shong&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Wed, 21 Jan 2015 05:07:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344962#M112553</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-21T05:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum values group by column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344963#M112554</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00539000004XsnJAAS"&gt;@shong&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;Thank you for your detailed solution!&lt;/P&gt; 
&lt;P&gt;Could you please explain this part:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;(Integer)globalMap.get(""+row1.Job+"")&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 07:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/cumulative-sum-values-group-by-column/m-p/2344963#M112554</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-30T07:50:58Z</dc:date>
    </item>
  </channel>
</rss>

