<?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 Providing Missing Records on Data Load based on Date Gaps in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222619#M75279</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;Need some help to build my data load here.&lt;/P&gt;&lt;P&gt;The situation is similar to this one. I have a STOCKS database with 4 fields :&lt;/P&gt;&lt;P&gt;- STOCK TICKER (or code/name)&lt;/P&gt;&lt;P&gt;- STOCK DATE&lt;/P&gt;&lt;P&gt;- STOCK QUANTITY (# of stocks)&lt;/P&gt;&lt;P&gt;- STOCK VALUE (on the DATE above)&lt;/P&gt;&lt;P&gt;This database has many different stock codes and many dates.&lt;/P&gt;&lt;P&gt;I need to calculate the TOTAL value which is the sum of (STOCK QUANTITY * STOCK VALUE) per DATE. This will go into a graph of the TOTAL value per day.&lt;/P&gt;&lt;P&gt;The problem ? Not all STOCKS have trades every day. For the days we dont have a RECORD on the database for a particular STOCK, we should repeat the day before. Because if not, we have GAPS on the graph !&lt;/P&gt;&lt;P&gt;Say for instance a MICRO stock code that has records for days 18/01/2010 and 23/01/2010. Between those dates we should repeat or populate fake records with the value of 18/01/2010 (the latest one we had).&lt;/P&gt;&lt;P&gt;An even worse problem occurs AT THE END of the file cause I may have records for say GOOG stock code until today (26/01/2010) but I dont have records for the MICRO stock code. So I should REPEAT the latest record for MICRO from 23/01/2010 until 26/01/2010.&lt;/P&gt;&lt;P&gt;Got it ?&lt;/P&gt;&lt;P&gt;Really dont know what to do. Think some sort of FOR/NEXT looping accross the dates. But have no idea.&lt;/P&gt;&lt;P&gt;Thanks 4 your support !&lt;/P&gt;&lt;P&gt;BTW you have attached a simple plain text file where I illustrate the situation. Missing records are denoted by "###########". Those are the places where we must provide or populate a fake record.&lt;/P&gt;&lt;P&gt;Once more, thank U !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jan 2010 14:54:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-01-26T14:54:15Z</dc:date>
    <item>
      <title>Providing Missing Records on Data Load based on Date Gaps</title>
      <link>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222619#M75279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;Need some help to build my data load here.&lt;/P&gt;&lt;P&gt;The situation is similar to this one. I have a STOCKS database with 4 fields :&lt;/P&gt;&lt;P&gt;- STOCK TICKER (or code/name)&lt;/P&gt;&lt;P&gt;- STOCK DATE&lt;/P&gt;&lt;P&gt;- STOCK QUANTITY (# of stocks)&lt;/P&gt;&lt;P&gt;- STOCK VALUE (on the DATE above)&lt;/P&gt;&lt;P&gt;This database has many different stock codes and many dates.&lt;/P&gt;&lt;P&gt;I need to calculate the TOTAL value which is the sum of (STOCK QUANTITY * STOCK VALUE) per DATE. This will go into a graph of the TOTAL value per day.&lt;/P&gt;&lt;P&gt;The problem ? Not all STOCKS have trades every day. For the days we dont have a RECORD on the database for a particular STOCK, we should repeat the day before. Because if not, we have GAPS on the graph !&lt;/P&gt;&lt;P&gt;Say for instance a MICRO stock code that has records for days 18/01/2010 and 23/01/2010. Between those dates we should repeat or populate fake records with the value of 18/01/2010 (the latest one we had).&lt;/P&gt;&lt;P&gt;An even worse problem occurs AT THE END of the file cause I may have records for say GOOG stock code until today (26/01/2010) but I dont have records for the MICRO stock code. So I should REPEAT the latest record for MICRO from 23/01/2010 until 26/01/2010.&lt;/P&gt;&lt;P&gt;Got it ?&lt;/P&gt;&lt;P&gt;Really dont know what to do. Think some sort of FOR/NEXT looping accross the dates. But have no idea.&lt;/P&gt;&lt;P&gt;Thanks 4 your support !&lt;/P&gt;&lt;P&gt;BTW you have attached a simple plain text file where I illustrate the situation. Missing records are denoted by "###########". Those are the places where we must provide or populate a fake record.&lt;/P&gt;&lt;P&gt;Once more, thank U !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2010 14:54:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222619#M75279</guid>
      <dc:creator />
      <dc:date>2010-01-26T14:54:15Z</dc:date>
    </item>
    <item>
      <title>Repeating Records on Data Load</title>
      <link>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222620#M75280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is it possible that you could enclose a file with an example (doesn't have to be the real data). I'm sure I have a simple solution for you but I always prefer to look first at the original data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2010 15:15:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222620#M75280</guid>
      <dc:creator />
      <dc:date>2010-01-26T15:15:49Z</dc:date>
    </item>
    <item>
      <title>Repeating Records on Data Load</title>
      <link>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222621#M75281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok ! Well I have prepared an example QVW. It's a simulation, not real data of course.&lt;/P&gt;&lt;P&gt;On the attached file you can see that asset code # 185 does not have values for 16 and 17/01/2010.&lt;/P&gt;&lt;P&gt;Code # 201 also does not have values for 15, 16 and 17/01/2010. Nor for 9,10 and 11/01/2010.&lt;/P&gt;&lt;P&gt;Codd # 996 does not have values at the end. It ends on 21/01/2010 and most of the others end on 22/01/2010.&lt;/P&gt;&lt;P&gt;You can see that the TOTAL ASSET VALUE PER DATE graph is somewhat distorted due to those gaps. It's not a "real" situation graph.&lt;/P&gt;&lt;P&gt;Hope you can help me out !&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2010 16:19:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222621#M75281</guid>
      <dc:creator />
      <dc:date>2010-01-26T16:19:37Z</dc:date>
    </item>
    <item>
      <title>Repeating Records on Data Load</title>
      <link>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222622#M75282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Below you have an answer for your question.&lt;/P&gt;&lt;P&gt;I hope I could help you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;ASSETS:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt; * &lt;B&gt;INLINE&lt;/B&gt; [&lt;/P&gt;&lt;P&gt;ASSET_CODE;ASSET_DATE; ASSET_VALUE&lt;/P&gt;&lt;P&gt;808;31/12/2009; 16103,09&lt;/P&gt;&lt;P&gt;999;05/01/2010; 09943,25&lt;/P&gt;&lt;P&gt;257;31/12/2009; 00094,75&lt;/P&gt;&lt;P&gt;996;31/12/2009; 84821,09&lt;/P&gt;&lt;P&gt;705;31/12/2009; 83471,40&lt;/P&gt;&lt;P&gt;991;31/12/2009; 82748,10&lt;/P&gt;&lt;P&gt;240;31/12/2009; 29651,59&lt;/P&gt;&lt;P&gt;999;04/01/2010; 08955,29&lt;/P&gt;&lt;P&gt;999;31/12/2009; 05728,62&lt;/P&gt;&lt;P&gt;201;31/12/2009; 57922,47&lt;/P&gt;&lt;P&gt;185;04/01/2010; 98149,35&lt;/P&gt;&lt;P&gt;808;04/01/2010; 18281,20&lt;/P&gt;&lt;P&gt;996;04/01/2010; 84525,72&lt;/P&gt;&lt;P&gt;991;04/01/2010; 84183,26&lt;/P&gt;&lt;P&gt;705;04/01/2010; 83437,21&lt;/P&gt;&lt;P&gt;201;04/01/2010; 58481,93&lt;/P&gt;&lt;P&gt;258;04/01/2010; 51154,28&lt;/P&gt;&lt;P&gt;240;04/01/2010; 30098,72&lt;/P&gt;&lt;P&gt;185;05/01/2010; 98518,20&lt;/P&gt;&lt;P&gt;808;05/01/2010; 18915,52&lt;/P&gt;&lt;P&gt;258;05/01/2010; 51087,71&lt;/P&gt;&lt;P&gt;991;05/01/2010; 84102,77&lt;/P&gt;&lt;P&gt;705;05/01/2010; 83573,72&lt;/P&gt;&lt;P&gt;996;05/01/2010; 81598,91&lt;/P&gt;&lt;P&gt;201;05/01/2010; 58674,84&lt;/P&gt;&lt;P&gt;240;05/01/2010; 30263,67&lt;/P&gt;&lt;P&gt;999;07/01/2010; 10977,89&lt;/P&gt;&lt;P&gt;185;06/01/2010; 99002,75&lt;/P&gt;&lt;P&gt;808;06/01/2010; 20034,17&lt;/P&gt;&lt;P&gt;258;06/01/2010; 51125,75&lt;/P&gt;&lt;P&gt;991;06/01/2010; 84960,14&lt;/P&gt;&lt;P&gt;705;06/01/2010; 83628,91&lt;/P&gt;&lt;P&gt;201;06/01/2010; 59015,60&lt;/P&gt;&lt;P&gt;240;06/01/2010; 30487,65&lt;/P&gt;&lt;P&gt;185;07/01/2010; 98916,59&lt;/P&gt;&lt;P&gt;808;07/01/2010; 19900,18&lt;/P&gt;&lt;P&gt;999;08/01/2010; 11198,35&lt;/P&gt;&lt;P&gt;258;07/01/2010; 51187,56&lt;/P&gt;&lt;P&gt;991;07/01/2010; 84522,71&lt;/P&gt;&lt;P&gt;705;07/01/2010; 83782,84&lt;/P&gt;&lt;P&gt;996;07/01/2010; 82259,32&lt;/P&gt;&lt;P&gt;201;07/01/2010; 59382,00&lt;/P&gt;&lt;P&gt;240;07/01/2010; 30209,02&lt;/P&gt;&lt;P&gt;185;08/01/2010; 99233,08&lt;/P&gt;&lt;P&gt;808;08/01/2010; 19985,00&lt;/P&gt;&lt;P&gt;999;11/01/2010; 11112,15&lt;/P&gt;&lt;P&gt;258;08/01/2010; 51201,82&lt;/P&gt;&lt;P&gt;991;08/01/2010; 84809,67&lt;/P&gt;&lt;P&gt;705;08/01/2010; 83861,27&lt;/P&gt;&lt;P&gt;240;08/01/2010; 30134,02&lt;/P&gt;&lt;P&gt;185;11/01/2010; 99132,60&lt;/P&gt;&lt;P&gt;808;11/01/2010; 19853,47&lt;/P&gt;&lt;P&gt;999;12/01/2010; 10420,46&lt;/P&gt;&lt;P&gt;258;11/01/2010; 51237,48&lt;/P&gt;&lt;P&gt;991;11/01/2010; 84841,16&lt;/P&gt;&lt;P&gt;705;11/01/2010; 84029,73&lt;/P&gt;&lt;P&gt;996;11/01/2010; 81502,26&lt;/P&gt;&lt;P&gt;201;08/01/2010; 59795,87&lt;/P&gt;&lt;P&gt;240;11/01/2010; 30112,08&lt;/P&gt;&lt;P&gt;258;11/01/2010; 51237,48&lt;/P&gt;&lt;P&gt;257;11/01/2010; 00459,88&lt;/P&gt;&lt;P&gt;258;31/12/2009; 51092,09&lt;/P&gt;&lt;P&gt;257;05/01/2010; 00249,07&lt;/P&gt;&lt;P&gt;257;06/01/2010; 00335,87&lt;/P&gt;&lt;P&gt;257;07/01/2010; 00360,67&lt;/P&gt;&lt;P&gt;257;08/01/2010; 00391,67&lt;/P&gt;&lt;P&gt;185;12/01/2010; 99069,58&lt;/P&gt;&lt;P&gt;808;12/01/2010; 20615,63&lt;/P&gt;&lt;P&gt;999;13/01/2010; 11131,15&lt;/P&gt;&lt;P&gt;257;12/01/2010; 00428,88&lt;/P&gt;&lt;P&gt;991;12/01/2010; 84802,67&lt;/P&gt;&lt;P&gt;705;12/01/2010; 84009,39&lt;/P&gt;&lt;P&gt;996;12/01/2010; 81061,05&lt;/P&gt;&lt;P&gt;201;12/01/2010; 60425,65&lt;/P&gt;&lt;P&gt;258;12/01/2010; 51213,71&lt;/P&gt;&lt;P&gt;240;12/01/2010; 29585,72&lt;/P&gt;&lt;P&gt;185;13/01/2010; 98758,42&lt;/P&gt;&lt;P&gt;808;13/01/2010; 20818,46&lt;/P&gt;&lt;P&gt;257;13/01/2010; 00497,08&lt;/P&gt;&lt;P&gt;991;13/01/2010; 84655,69&lt;/P&gt;&lt;P&gt;705;13/01/2010; 84064,58&lt;/P&gt;&lt;P&gt;201;13/01/2010; 60333,57&lt;/P&gt;&lt;P&gt;258;13/01/2010; 51273,14&lt;/P&gt;&lt;P&gt;240;13/01/2010; 29641,17&lt;/P&gt;&lt;P&gt;999;14/01/2010; 10998,76&lt;/P&gt;&lt;P&gt;185;14/01/2010; 98414,84&lt;/P&gt;&lt;P&gt;808;14/01/2010; 19413,38&lt;/P&gt;&lt;P&gt;999;15/01/2010; 09797,85&lt;/P&gt;&lt;P&gt;257;14/01/2010; 00521,88&lt;/P&gt;&lt;P&gt;991;14/01/2010; 84393,23&lt;/P&gt;&lt;P&gt;705;14/01/2010; 83991,97&lt;/P&gt;&lt;P&gt;996;14/01/2010; 81149,25&lt;/P&gt;&lt;P&gt;201;14/01/2010; 60448,31&lt;/P&gt;&lt;P&gt;258;14/01/2010; 51313,56&lt;/P&gt;&lt;P&gt;240;14/01/2010; 29283,35&lt;/P&gt;&lt;P&gt;185;15/01/2010; 98354,40&lt;/P&gt;&lt;P&gt;808;15/01/2010; 18073,45&lt;/P&gt;&lt;P&gt;999;18/01/2010; 10540,00&lt;/P&gt;&lt;P&gt;257;15/01/2010; 00459,88&lt;/P&gt;&lt;P&gt;991;15/01/2010; 83584,85&lt;/P&gt;&lt;P&gt;996;15/01/2010; 78739,16&lt;/P&gt;&lt;P&gt;258;15/01/2010; 51199,45&lt;/P&gt;&lt;P&gt;240;15/01/2010; 28886,44&lt;/P&gt;&lt;P&gt;185;18/01/2010; 99048,88&lt;/P&gt;&lt;P&gt;808;18/01/2010; 18480,35&lt;/P&gt;&lt;P&gt;705;18/01/2010; 84166,24&lt;/P&gt;&lt;P&gt;991;18/01/2010; 83808,82&lt;/P&gt;&lt;P&gt;996;18/01/2010; 76960,00&lt;/P&gt;&lt;P&gt;201;18/01/2010; 60478,39&lt;/P&gt;&lt;P&gt;258;18/01/2010; 51251,75&lt;/P&gt;&lt;P&gt;240;18/01/2010; 29083,10&lt;/P&gt;&lt;P&gt;999;20/01/2010; 08472,87&lt;/P&gt;&lt;P&gt;185;19/01/2010; 99436,46&lt;/P&gt;&lt;P&gt;808;19/01/2010; 19750,21&lt;/P&gt;&lt;P&gt;257;19/01/2010; 00565,28&lt;/P&gt;&lt;P&gt;991;19/01/2010; 84396,73&lt;/P&gt;&lt;P&gt;705;19/01/2010; 84145,91&lt;/P&gt;&lt;P&gt;996;19/01/2010; 76262,47&lt;/P&gt;&lt;P&gt;201;19/01/2010; 60730,10&lt;/P&gt;&lt;P&gt;258;19/01/2010; 51382,50&lt;/P&gt;&lt;P&gt;240;19/01/2010; 29354,96&lt;/P&gt;&lt;P&gt;185;20/01/2010; 98706,97&lt;/P&gt;&lt;P&gt;808;20/01/2010; 17327,27&lt;/P&gt;&lt;P&gt;999;21/01/2010; 05362,78&lt;/P&gt;&lt;P&gt;257;20/01/2010; 00571,48&lt;/P&gt;&lt;P&gt;705;20/01/2010; 84177,85&lt;/P&gt;&lt;P&gt;991;20/01/2010; 83105,42&lt;/P&gt;&lt;P&gt;996;20/01/2010; 71853,36&lt;/P&gt;&lt;P&gt;258;20/01/2010; 51394,38&lt;/P&gt;&lt;P&gt;240;20/01/2010; 28753,61&lt;/P&gt;&lt;P&gt;185;21/01/2010; 97568,89&lt;/P&gt;&lt;P&gt;808;21/01/2010; 14443,35&lt;/P&gt;&lt;P&gt;999;22/01/2010; 05060,75&lt;/P&gt;&lt;P&gt;257;21/01/2010; 00571,48&lt;/P&gt;&lt;P&gt;705;21/01/2010; 84000,68&lt;/P&gt;&lt;P&gt;991;21/01/2010; 81432,68&lt;/P&gt;&lt;P&gt;996;21/01/2010; 72437,33&lt;/P&gt;&lt;P&gt;201;21/01/2010; 60081,97&lt;/P&gt;&lt;P&gt;258;21/01/2010; 51346,84&lt;/P&gt;&lt;P&gt;240;21/01/2010; 28214,68&lt;/P&gt;&lt;P&gt;185;22/01/2010; 97306,14&lt;/P&gt;&lt;P&gt;808;22/01/2010; 14336,41&lt;/P&gt;&lt;P&gt;257;22/01/2010; 00577,68&lt;/P&gt;&lt;P&gt;705;22/01/2010; 83974,54&lt;/P&gt;&lt;P&gt;991;22/01/2010; 81579,66&lt;/P&gt;&lt;P&gt;201;22/01/2010; 60317,86&lt;/P&gt;&lt;P&gt;258;22/01/2010; 51399,14&lt;/P&gt;&lt;P&gt;] (DELIMITER IS ';');&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//*********************************************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//First of all we must load the list of all codes (it must be done using DISTINCT method, so the codes won't be repeated)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Qualify&lt;/B&gt; *; &lt;B&gt;//Qualify - means, that on ther begining of every field name QlikView will put the name of a table, in this case CODES. (see the result)&lt;/B&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;CODES:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt; &lt;B&gt;DISTINCT&lt;/B&gt;&lt;/P&gt;&lt;P&gt;ASSET_CODE&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; ASSETS;&lt;/P&gt;&lt;P style="font-style: italic"&gt;MIN_MAX:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;P&gt;Min(Num(Date(ASSET_DATE, 'DD/MM/YYYY'))) &lt;B&gt;AS&lt;/B&gt; MIN, &lt;B&gt;//Here we check what is the first date, when the asset was present (we must convert the date into number first)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Max(Num(Date(ASSET_DATE, 'DD/MM/YYYY'))) &lt;B&gt;AS&lt;/B&gt; MAX &lt;B&gt;//Here we check what is the last date, when the asset was present (we must convert the date into number first)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; ASSETS;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Let&lt;/B&gt; min = PEEK('MIN_MAX.MIN', 0, MIN_MAX); &lt;B&gt;//Here we download the data from table MIN_MAX&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Let&lt;/B&gt; max = PEEK('MIN_MAX.MAX', 0, MIN_MAX); &lt;B&gt;// ------//-----------------------------------&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;DROP&lt;/B&gt; &lt;B&gt;TABLE&lt;/B&gt; &lt;I&gt;MIN_MAX;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Unqualify&lt;/B&gt; *; &lt;B&gt;// Unqualify - stops the adding the table name on the begining of each field name&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//*****************************************************************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//We must download the assets fro each ASSET_CODE for each possible ASSET_DATE (between First and Last ASSET_DATE)&lt;/P&gt;&lt;P&gt;&lt;B&gt;Let&lt;/B&gt; a = &lt;B&gt;&lt;I&gt;$(min)&lt;/I&gt;&lt;/B&gt;;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;do&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Here we must check when was the last asset before certain date (variable $(a))&lt;/P&gt;&lt;P style="font-style: italic"&gt;DATA_temp:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;P&gt;ASSET_CODE &lt;B&gt;AS&lt;/B&gt; ASSET_CODE_temp,&lt;/P&gt;&lt;P&gt;Max(Num(Date(ASSET_DATE, 'DD/MM/YYYY'))) &lt;B&gt;AS&lt;/B&gt; ASSET_DATE_temp_1&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; ASSETS&lt;/P&gt;&lt;P style="font-weight: bold"&gt;WHERE&lt;/P&gt;&lt;P&gt;Num(Date(ASSET_DATE, 'DD/MM/YYYY')) &amp;lt;= &lt;B&gt;&lt;I&gt;$(a)&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;GROUP&lt;/B&gt; &lt;B&gt;BY&lt;/B&gt;&lt;/P&gt;&lt;P&gt;ASSET_CODE;&lt;/P&gt;&lt;P&gt;&lt;B&gt;LEFT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//When we have the last date, when the asset was present, then we can look for it in the table ASSETS&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;P&gt;ASSET_CODE &lt;B&gt;AS&lt;/B&gt; ASSET_CODE_temp,&lt;/P&gt;&lt;P&gt;Num(Date(ASSET_DATE, 'DD/MM/YYYY')) &lt;B&gt;AS&lt;/B&gt; ASSET_DATE_temp_1,&lt;/P&gt;&lt;P&gt;ASSET_VALUE &lt;B&gt;AS&lt;/B&gt; ASSET_VALUE_temp&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; ASSETS&lt;/P&gt;&lt;P&gt;&lt;B&gt;WHERE&lt;/B&gt; Num(Date(ASSET_DATE, 'DD/MM/YYYY')) &amp;lt;= &lt;B&gt;&lt;I&gt;$(a)&lt;/I&gt;&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;B&gt;RIGHT&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;//Now we can can add the list of all ASSET_CODES&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;P&gt;CODES.ASSET_CODE &lt;B&gt;AS&lt;/B&gt; ASSET_CODE_temp,&lt;/P&gt;&lt;P&gt;(&lt;B&gt;&lt;I&gt;$(a)&lt;/I&gt;&lt;/B&gt;) &lt;B&gt;AS&lt;/B&gt; ASSET_DATE_temp&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; CODES;&lt;/P&gt;&lt;P style="font-style: italic"&gt;DATA:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;P&gt;ASSET_CODE_temp &lt;B&gt;AS&lt;/B&gt; ASSET_CODE_final,&lt;/P&gt;&lt;P&gt;Date(ASSET_DATE_temp, 'DD/MM/YYYY') &lt;B&gt;AS&lt;/B&gt; ASSET_DATE_final,&lt;/P&gt;&lt;P&gt;If(IsNull(ASSET_VALUE_temp), 0, ASSET_VALUE_temp) &lt;B&gt;AS&lt;/B&gt; ASSET_VALUE_final &lt;B&gt;//If there was no asset on the beggining (for example you will have new ASSET CODE, which never existed before)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; DATA_temp; &lt;B&gt;//then the first ASSET_VALUE is zero (see ASSET_CODE no. 185)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;DROP&lt;/B&gt; &lt;B&gt;TABLE&lt;/B&gt; &lt;I&gt;DATA_temp;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;exit&lt;/B&gt; &lt;B&gt;do&lt;/B&gt; &lt;B&gt;when&lt;/B&gt; a = max&lt;/P&gt;&lt;P&gt;&lt;B&gt;Let&lt;/B&gt; a=a+1;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;loop&lt;/P&gt;&lt;P&gt;&lt;B&gt;DROP&lt;/B&gt; &lt;B&gt;TABLE&lt;/B&gt; &lt;I&gt;CODES;&lt;/I&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;// If you use the section below, you will choose only dates, which exist in table ASSETS, otherwise you will get all dates between First date and Last date (example 01/01/2010 which is not&lt;/P&gt;&lt;P style="font-weight: bold"&gt;// present in table ASSETS). But this is you decision&lt;/P&gt;&lt;P&gt;&lt;B&gt;INNER&lt;/B&gt; &lt;B&gt;JOIN&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt; &lt;B&gt;DISTINCT&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Date(ASSET_DATE, 'DD/MM/YYYY') &lt;B&gt;AS&lt;/B&gt; ASSET_DATE_final&lt;/P&gt;&lt;P&gt;&lt;B&gt;RESIDENT&lt;/B&gt; ASSETS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 16:22:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222622#M75282</guid>
      <dc:creator />
      <dc:date>2010-01-28T16:22:37Z</dc:date>
    </item>
    <item>
      <title>Repeating Records on Data Load</title>
      <link>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222623#M75283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh My God !&lt;/P&gt;&lt;P&gt;I SHALL take some DAYS to understand what you've done !&lt;/P&gt;&lt;P&gt;Thank you so much !&lt;/P&gt;&lt;P&gt;There's a lot of stuff in there that I dont know .&lt;/P&gt;&lt;P&gt;Thank you again !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 17:46:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222623#M75283</guid>
      <dc:creator />
      <dc:date>2010-01-28T17:46:59Z</dc:date>
    </item>
    <item>
      <title>Repeating Records on Data Load</title>
      <link>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222624#M75284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wanted to attach a file but there was some technical problems with QlikView website.&lt;/P&gt;&lt;P&gt;If you want to get a .qvw file just send me an e-mail.&lt;/P&gt;&lt;P&gt;My address is: pauleinigh@o2.pl&lt;/P&gt;&lt;P&gt;I'm glad to hear that you can learn something from me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 20:17:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222624#M75284</guid>
      <dc:creator />
      <dc:date>2010-01-28T20:17:23Z</dc:date>
    </item>
    <item>
      <title>Providing Missing Records on Data Load based on Date Gaps</title>
      <link>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222625#M75285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Qlikview Cookbook example titled "Fill values in a data range using previous values." is a pretty close match to your problem.&lt;/P&gt;&lt;P&gt;You can get the Cookbook from:&lt;BR /&gt;&lt;A href="http://robwunderlich.com/Download.html"&gt;http://robwunderlich.com/Download.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 21:52:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Providing-Missing-Records-on-Data-Load-based-on-Date-Gaps/m-p/222625#M75285</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2010-01-28T21:52:16Z</dc:date>
    </item>
  </channel>
</rss>

