<?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: Need suggestions - Insert dummy records for weekend data in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Need-suggestions-Insert-dummy-records-for-weekend-data/m-p/2217768#M13228</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; One possible simple solution is as below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a) Read the data set containing date values for full year (you can use multiple methods to generate this data set. For simplicity, lets assume, its a file). This will be your main flow.&lt;/P&gt;
&lt;P&gt;b)&amp;nbsp;Use a tMap with left outer join and read the existing input file (dtst 1) as lookup. Join based on the date value and the output will be records with values for some dates and null for some other dates&lt;/P&gt;
&lt;P&gt;c) Pass the data to tSortrow to arrange the records according to date.&lt;/P&gt;
&lt;P&gt;d) Pass the data to tFlowtoIterate to send the records one at a time&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e) Connect a tJavarow and read the value coming for each date and store in a context variable. In the next loop, the value for the next day will be cross checked whetehr it is null. If it is null, the value will be replaced with the value in context variable (from previous day).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;f) Write the output of tJavarow to a tfileoutputdelimited in append mode&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Please note that this is just one way of doing the process. If the answer has helped you, could you please mark the topic as solution provided? Kudos are also welcome.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 06:11:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-09-26T06:11:23Z</dc:date>
    <item>
      <title>Need suggestions - Insert dummy records for weekend data</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-suggestions-Insert-dummy-records-for-weekend-data/m-p/2217767#M13227</link>
      <description>&lt;P&gt;I've an ETL job which processes a raw file into a MySQL DB. While doing some analysis, I realized that I need data for all the days in a month and my data feed only has values for weekdays.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I need a way to embedd records for the missing days, with data from the last day. e.g. for Saturday and Sunday, I'd want to use data from Friday. For missing Wednesday, I can use data from Tuesday.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Visually this is what I am looking at:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;TABLE&gt; 
 &lt;TBODY&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Day&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;Old Table&lt;/TD&gt; 
   &lt;TD&gt;New Table&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Monday&lt;/TD&gt; 
   &lt;TD&gt;Record 1&lt;/TD&gt; 
   &lt;TD&gt;Record 1&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Tuesday&lt;/TD&gt; 
   &lt;TD&gt;Record 2&lt;/TD&gt; 
   &lt;TD&gt;Record 2&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Wednesday&lt;/TD&gt; 
   &lt;TD&gt;Record 3&lt;/TD&gt; 
   &lt;TD&gt;Record 3&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Thursday&lt;/TD&gt; 
   &lt;TD&gt;Record 4&lt;/TD&gt; 
   &lt;TD&gt;Record 4&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Friday&lt;/TD&gt; 
   &lt;TD&gt;Record 5&lt;/TD&gt; 
   &lt;TD&gt;Record 5&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Saturday&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;Record 5&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Sunday&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;Record 5&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Monday&lt;/TD&gt; 
   &lt;TD&gt;Record 8&lt;/TD&gt; 
   &lt;TD&gt;Record 8&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Tuesday&lt;/TD&gt; 
   &lt;TD&gt;Record 9&lt;/TD&gt; 
   &lt;TD&gt;Record 9&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Wednesday&lt;/TD&gt; 
   &lt;TD&gt;Record 10&lt;/TD&gt; 
   &lt;TD&gt;Record 10&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Thursday&lt;/TD&gt; 
   &lt;TD&gt;Record 11&lt;/TD&gt; 
   &lt;TD&gt;Record 11&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Friday&lt;/TD&gt; 
   &lt;TD&gt;Record 12&lt;/TD&gt; 
   &lt;TD&gt;Record 12&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Saturday&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;Record 12&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Sunday&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;Record 12&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;Monday&lt;/TD&gt; 
   &lt;TD&gt;Record 15&lt;/TD&gt; 
   &lt;TD&gt;Record 15&lt;/TD&gt; 
  &lt;/TR&gt; 
 &lt;/TBODY&gt; 
&lt;/TABLE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Could someone recommend me a way?&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My vague thoughts are converging around working with three datasets:&lt;/P&gt; 
&lt;P&gt;1) Temp data set with all the date values in it (say start of year till end of year)&lt;/P&gt; 
&lt;P&gt;2) Original Data which contains missing records (dtst 1)&lt;/P&gt; 
&lt;P&gt;3) New data, which has all the values (dtst 2)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I don't know how to but if I could loop through all the values in the temp dataset (dtst 1), pull value against the date from the original data and push it in the new dataset (dtst 2). If I don't identify a value in dtst 1, I use the last row fetched from the dtst 1 and push it in the dtst 2. At the end of the loop execution, I'll have data for all the dates in my dtst 2, which I can later use for my analysis.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 21:32:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-suggestions-Insert-dummy-records-for-weekend-data/m-p/2217767#M13227</guid>
      <dc:creator>sushantV</dc:creator>
      <dc:date>2018-09-25T21:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need suggestions - Insert dummy records for weekend data</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-suggestions-Insert-dummy-records-for-weekend-data/m-p/2217768#M13228</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; One possible simple solution is as below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a) Read the data set containing date values for full year (you can use multiple methods to generate this data set. For simplicity, lets assume, its a file). This will be your main flow.&lt;/P&gt;
&lt;P&gt;b)&amp;nbsp;Use a tMap with left outer join and read the existing input file (dtst 1) as lookup. Join based on the date value and the output will be records with values for some dates and null for some other dates&lt;/P&gt;
&lt;P&gt;c) Pass the data to tSortrow to arrange the records according to date.&lt;/P&gt;
&lt;P&gt;d) Pass the data to tFlowtoIterate to send the records one at a time&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e) Connect a tJavarow and read the value coming for each date and store in a context variable. In the next loop, the value for the next day will be cross checked whetehr it is null. If it is null, the value will be replaced with the value in context variable (from previous day).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;f) Write the output of tJavarow to a tfileoutputdelimited in append mode&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Please note that this is just one way of doing the process. If the answer has helped you, could you please mark the topic as solution provided? Kudos are also welcome.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 06:11:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-suggestions-Insert-dummy-records-for-weekend-data/m-p/2217768#M13228</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-26T06:11:23Z</dc:date>
    </item>
  </channel>
</rss>

