<?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: Data Integration CSV File - Populate a cell with previous rows value for that cell in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223697#M16716</link>
    <description>Thank you Nikhil for the help it was much appreciated and solved my problem once I learned about context variables! Thanks again
&lt;BR /&gt;
&lt;BR /&gt;Neil.</description>
    <pubDate>Wed, 12 Dec 2018 02:12:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-12-12T02:12:54Z</dc:date>
    <item>
      <title>Data Integration CSV File - Populate a cell with previous rows value for that cell</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223694#M16713</link>
      <description>&lt;P&gt;Hey folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Newbie to Talend here and getting stuck with processing a CSV file. Basically I want to check a row in my CSV file and if the data in a cell is empty I wish to populate it with the value from the previous rows. example of rows below. So in the example below for the Year in the 4th row I'd like this to be 2000 etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to use a "tjavarow" function but got completely lost any help is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Neil&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:04:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223694#M16713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T07:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Data Integration CSV File - Populate a cell with previous rows value for that cell</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223695#M16714</link>
      <description>&lt;P&gt;MovieID Year Title Publisher Superheroes Noofsuperheroes RTscoreper Distributor&amp;nbsp;&lt;BR /&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2000 X-Men Marvel Xavier 13 81% 20th Century Fox 7/14/00 75 296339527&lt;BR /&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X-Men Marvel Wolverine 13 81%&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 23:19:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223695#M16714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-10T23:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Data Integration CSV File - Populate a cell with previous rows value for that cell</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223696#M16715</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Your approach to use tjavarow is a right one. You need to make only minor change. You need to assign the value to a context variable also so that you can reuse it for next iteration. A sample pseudo code is as shown below.&lt;/P&gt;
&lt;P&gt;Step 1:-&lt;/P&gt;
&lt;P&gt;assign empty string or null to variable&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Year&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;in context section. This is to handle the value as null for first row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 2:-&lt;/P&gt;
&lt;P&gt;In tjavarow, do the below logic&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if (input_row.Year== null)&lt;BR /&gt;{&lt;BR /&gt;output_row.Year=context.year;&amp;nbsp; &amp;nbsp; // which will pick the value in context instead of input record&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;output_row.Year=input_row.Year;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;context.year=input_row.Year; //update value of context which will be used for next row&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope the idea has answered your query. Could you please mark the topic as resolved if you are happy? Kudos are also welcome &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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nikhil Thampi&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 05:39:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223696#M16715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-11T05:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Data Integration CSV File - Populate a cell with previous rows value for that cell</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223697#M16716</link>
      <description>Thank you Nikhil for the help it was much appreciated and solved my problem once I learned about context variables! Thanks again
&lt;BR /&gt;
&lt;BR /&gt;Neil.</description>
      <pubDate>Wed, 12 Dec 2018 02:12:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Data-Integration-CSV-File-Populate-a-cell-with-previous-rows/m-p/2223697#M16716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-12T02:12:54Z</dc:date>
    </item>
  </channel>
</rss>

