<?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 Fill missing values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Fill-missing-values/m-p/1384373#M421629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem with getting the right values into the dates.&lt;/P&gt;&lt;P&gt;If there's only one missing Date (2017-08-04) the Value should be the next Value (30).&lt;/P&gt;&lt;P&gt;If several Dates are missing I want to take the previous Value (2017-08-07) 30 and the next Value (2017-08-11) 25. 30+25/2 and fill the rows 2017-08-08 to 2017-08-10 with the Value 27,5. Now I get 25 on each row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Excel (Missing dates 207-08-04, 2017-08-08 to 2017-08-10):&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="178411" alt="Excel.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/178411_Excel.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;tmp:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD Article, Store, Value, Date&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FROM [MyTest.xlsx] (ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;tmp_1:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;load&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Article,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Store,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Value,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;RecNo() as rad,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;if(Article = Previous(Article) and Store = Previous(Store), peek('Date'), date(Date-1) )as Previous_date,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;if(Article = Previous(Article) and Store = Previous(Store), Date - peek('Date'),1 )as DaysBetween&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Resident tmp Order by Article, Date, Date;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;DROP Table tmp;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;tmp_2:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;load&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;*,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;date(Previous_date+IterNo()) as NewDate&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Resident tmp_1 While Previous_date+IterNo()&amp;lt;= Date;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;DROP Table tmp_1;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P&gt;Loaded script:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="178409" alt="Bild.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/178409_Bild.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Oct 2017 11:36:54 GMT</pubDate>
    <dc:creator>sfloberg</dc:creator>
    <dc:date>2017-10-03T11:36:54Z</dc:date>
    <item>
      <title>Fill missing values</title>
      <link>https://community.qlik.com/t5/QlikView/Fill-missing-values/m-p/1384373#M421629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem with getting the right values into the dates.&lt;/P&gt;&lt;P&gt;If there's only one missing Date (2017-08-04) the Value should be the next Value (30).&lt;/P&gt;&lt;P&gt;If several Dates are missing I want to take the previous Value (2017-08-07) 30 and the next Value (2017-08-11) 25. 30+25/2 and fill the rows 2017-08-08 to 2017-08-10 with the Value 27,5. Now I get 25 on each row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Excel (Missing dates 207-08-04, 2017-08-08 to 2017-08-10):&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="178411" alt="Excel.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/178411_Excel.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;tmp:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD Article, Store, Value, Date&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FROM [MyTest.xlsx] (ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;tmp_1:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;load&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Article,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Store,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Value,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;RecNo() as rad,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;if(Article = Previous(Article) and Store = Previous(Store), peek('Date'), date(Date-1) )as Previous_date,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;if(Article = Previous(Article) and Store = Previous(Store), Date - peek('Date'),1 )as DaysBetween&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Resident tmp Order by Article, Date, Date;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;DROP Table tmp;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;tmp_2:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;load&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;*,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;date(Previous_date+IterNo()) as NewDate&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Resident tmp_1 While Previous_date+IterNo()&amp;lt;= Date;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;DROP Table tmp_1;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P&gt;Loaded script:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="178409" alt="Bild.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/178409_Bild.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Oct 2017 11:36:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fill-missing-values/m-p/1384373#M421629</guid>
      <dc:creator>sfloberg</dc:creator>
      <dc:date>2017-10-03T11:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Fill missing values</title>
      <link>https://community.qlik.com/t5/QlikView/Fill-missing-values/m-p/1384374#M421630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stephanie,&lt;/P&gt;&lt;P&gt;may be this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Temp:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style=": ; color: #0000ff;"&gt;LOAD&lt;/STRONG&gt; * &lt;SPAN style="color: #0000ff;"&gt;Inline&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;[&lt;BR /&gt; Article,Store,Value,Date&lt;BR /&gt; 1,a,10,2017-08-01&lt;BR /&gt; 1,a,20,2017-08-02&lt;BR /&gt; 1,a,15,2017-08-03&lt;BR /&gt; 1,a,30,2017-08-05&lt;BR /&gt; 1,a,5,2017-08-06&lt;BR /&gt; 1,a,30,2017-08-07&lt;BR /&gt; 1,a,25,2017-08-11&lt;BR /&gt; 1,a,2,2017-08-12&lt;BR /&gt; 1,a,37,2017-08-13&lt;BR /&gt; 1,a,52,2017-08-14&lt;BR /&gt; 1,a,50,2017-08-15&lt;BR /&gt; ]&lt;/SPAN&gt;;&lt;BR /&gt; Temp1:&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;LOAD&lt;/STRONG&gt; *,&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Article&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Article&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Store&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Store&lt;/SPAN&gt;),&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;)-&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt; &amp;lt;&amp;gt; 1,&lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;)-&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt; = 2,&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;),&lt;SPAN style="color: #0000ff;"&gt;RangeSum&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;)/2),0),0) &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Value1&lt;/SPAN&gt;,&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Article&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Article&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Store&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Store&lt;/SPAN&gt;),&lt;SPAN style="color: #0000ff;"&gt;Previous&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;+1) &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Date1&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Resident&lt;/SPAN&gt; Temp&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Order&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;By&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Article&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;Store&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Desc&lt;/SPAN&gt;;&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;Drop&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;Table&lt;/SPAN&gt; Temp;&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;LOAD&lt;/STRONG&gt; &lt;SPAN style="color: #800000;"&gt;Article&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;Store&lt;/SPAN&gt;,&lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;IterNo&lt;/SPAN&gt;()=1,&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;Value1&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;,&lt;SPAN style="color: #0000ff;"&gt;Date&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;+&lt;SPAN style="color: #0000ff;"&gt;IterNo&lt;/SPAN&gt;()-1) &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Resident&lt;/SPAN&gt; Temp1&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;While&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Date&lt;/SPAN&gt;+&lt;SPAN style="color: #0000ff;"&gt;IterNo&lt;/SPAN&gt;()-1 &amp;lt; &lt;SPAN style="color: #800000;"&gt;Date1&lt;/SPAN&gt;;&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;Drop&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;Table&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; Temp1; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/178446_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Antonio&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Oct 2017 14:06:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Fill-missing-values/m-p/1384374#M421630</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2017-10-03T14:06:34Z</dc:date>
    </item>
  </channel>
</rss>

