<?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: increment the date values with in range &amp; cumulative sum in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284158#M57909</link>
    <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOQcAAO"&gt;@karthik_T&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Why is the cumsum column is 0 between 11-11-2019 and 14-11-2019? I guess it should be 1 for those dates also.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please confirm.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2019 06:10:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-02-22T06:10:10Z</dc:date>
    <item>
      <title>increment the date values with in range &amp; cumulative sum</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284157#M57908</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to increment the date values with in range. can any one tell me how to achieve it&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the attached doc for input and output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 05:48:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284157#M57908</guid>
      <dc:creator>karthik_T</dc:creator>
      <dc:date>2019-02-22T05:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: increment the date values with in range &amp; cumulative sum</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284158#M57909</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOQcAAO"&gt;@karthik_T&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Why is the cumsum column is 0 between 11-11-2019 and 14-11-2019? I guess it should be 1 for those dates also.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please confirm.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 06:10:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284158#M57909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-22T06:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: increment the date values with in range &amp; cumulative sum</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284159#M57910</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.qlik.com/s/profile/00539000006eKOgAAM" target="_self"&gt;@nthampi&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;Yes,i got the cumulative sum result &amp;amp; now i want to increment the date values as shown in output.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 06:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284159#M57910</guid>
      <dc:creator>karthik_T</dc:creator>
      <dc:date>2019-02-22T06:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: increment the date values with in range &amp; cumulative sum</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284160#M57911</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; I am leaving the Csum to you as you know it. The objective is to fill the missing dates by referring to a calendar and it is as shown below.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3Kg.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155651iF04FB2CCDAD014C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3Kg.png" alt="0683p000009M3Kg.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The first stage is to delete the file where you want to store the calendar&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3Kl.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141181iE27B3C2E3FB65312/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3Kl.png" alt="0683p000009M3Kl.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Read the file and find the min and max date for each id.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3Kv.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144663iE8140FDC29C4B36C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3Kv.png" alt="0683p000009M3Kv.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Then send it to a tFLowtoIterate for iteration (to generate the dates between minimum and maximum calendar date for each id in iterative fashion)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The real magic is happening in trowgenerator.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3L0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132417i5FF52611ADF58BF2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3L0.png" alt="0683p000009M3L0.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please use the following values for each entry in trowgenerator.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;&lt;U&gt;&lt;STRONG&gt;id value&lt;/STRONG&gt; &lt;/U&gt;- Use the value from tFlowtoIterate

((String)globalMap.get("row2.id")) 

&lt;U&gt;&lt;STRONG&gt;date value&lt;/STRONG&gt;&lt;/U&gt; - Select Talend Date Add date function as shown in screen shot (exactly same function as there are multiple options for it)

&lt;U&gt;&lt;STRONG&gt;Number of rows in tRowgnerator&lt;/STRONG&gt; &lt;/U&gt;- Use Talend Diff date function to get the difference date between min and max dates. &lt;BR /&gt;The output will be in Long. Convert to integer by adding (int) at beginning and then add +1 to get last entry

 (int)TalendDate.diffDate(((java.util.Date)globalMap.get("row2.max_date")),((java.util.Date)globalMap.get("row2.min_date")),"dd")+1&lt;BR /&gt;&lt;BR /&gt;At parameter side, please provide below values&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;date&lt;/STRONG&gt; &lt;/U&gt;-     ((java.util.Date)globalMap.get("row2.min_date"))              (from tFlowtoIterate min date)&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;nb   &lt;/STRONG&gt; &lt;/U&gt;-     Numeric.sequence(((String)globalMap.get("row2.id")),0,1)      (note:- the sequence will repeat for each incoming id from tFlowtoiterate)&lt;BR /&gt;datetype - "dd" &lt;/PRE&gt; 
&lt;P&gt;Load the data to a calendar file in append mode&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3KI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147431i9255CDA6E5D64794/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3KI.png" alt="0683p000009M3KI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;In second subjob, calendar will be the mainflow and your input file will be input file&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3LA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145620i95AF12CBCD335612/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3LA.png" alt="0683p000009M3LA.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am attaching the job also (version 7.1 of Talend Data Fabric used for job creation) for reference.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope I answered your query. Before going, could you please mark the topic as resolved? Kudos will be bonus &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lv4U"&gt;testjob.zip&lt;/A&gt;</description>
      <pubDate>Fri, 22 Feb 2019 10:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284160#M57911</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-22T10:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: increment the date values with in range &amp; cumulative sum</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284161#M57912</link>
      <description>&lt;P&gt;Below two properties of tMap could be useful&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) tMap memorize previous run record&amp;nbsp; &amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCjPhCAK#M595" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/How-Tos-and-Best-Practices/Compare-row-value-against-a-value-from-the-previous-row/m-p/133710#M595&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;2) tMap ( Reload on each record ) could be used a row Multiplier&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCpvECAS#M1" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/How-Tos-and-Best-Practices/Row-Multiplication/m-p/39776#M1&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Algorithm&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1) get how many time each row should repeated . ( For this you could sort&amp;nbsp; input in descending order of Datevalue and Date difference from Previous Datevalue )&lt;/P&gt; 
&lt;P&gt;result should be like&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;102|20-11-2019|2|1&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;102|16-11-2019|0|4&lt;BR /&gt;101|15-11-2019|0|1&lt;BR /&gt;101|10-11-2019|1|5&lt;/P&gt; 
&lt;P&gt;2) use row Multiplier logic , and repeat same row n number of time. Also add 1 for each Iteration.&lt;/P&gt; 
&lt;P&gt;101|10-11-2019|1&lt;BR /&gt;101|11-11-2019|0&lt;BR /&gt;101|12-11-2019|0&lt;BR /&gt;101|13-11-2019|0&lt;BR /&gt;101|14-11-2019|0&lt;BR /&gt;101|15-11-2019|0&lt;BR /&gt;102|16-11-2019|0&lt;BR /&gt;102|17-11-2019|0&lt;BR /&gt;102|18-11-2019|0&lt;BR /&gt;102|19-11-2019|0&lt;/P&gt; 
&lt;P&gt;102|20-11-2019|2&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TalendImage.JPG" style="width: 898px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3L7.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145479i5147137F0E63E4CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3L7.jpg" alt="0683p000009M3L7.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Luq0"&gt;simplejob_0.1.zip&lt;/A&gt;</description>
      <pubDate>Fri, 22 Feb 2019 13:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284161#M57912</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-02-22T13:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: increment the date values with in range &amp; cumulative sum</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284162#M57913</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.qlik.com/s/profile/00539000006eKOgAAM" target="_self"&gt;@nthampi&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class=""&gt;Please explain the exp mentioned in attachment.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lupy"&gt;exp.png&lt;/A&gt;</description>
      <pubDate>Mon, 25 Feb 2019 07:01:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284162#M57913</guid>
      <dc:creator>karthik_T</dc:creator>
      <dc:date>2019-02-25T07:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: increment the date values with in range &amp; cumulative sum</title>
      <link>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284163#M57914</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The id will receive the value from tFlowtoiterate directly.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The date will have the minimum value and I have added a numeric sequence to add the dates from minimum date. This numeric sequence will add 1 to minimum date in sequential fashion to generate all dates.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The number of records will take the difference of maximum and minimum date+1. This will determine the number for records to be generated for each id.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The details at the bottom part will have the split up of Talend date function.The date column will store the starting date (min date in this case) and the nb will store the number to add to minimum date. Since we have added sequence function, the value will get incremented for each record.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 11:14:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/increment-the-date-values-with-in-range-cumulative-sum/m-p/2284163#M57914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-25T11:14:04Z</dc:date>
    </item>
  </channel>
</rss>

