<?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: Use previous value if no datapoint on given date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322632#M583810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for quick reply. &lt;/P&gt;&lt;P&gt;This feature is really nice, but it assumes that I have a row (at given date) for both accounts, but second account is just missing balance value (is null).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try and explain the scenario a bit differently.&lt;/P&gt;&lt;P&gt;We have the following tables :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="top"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;file1.csv&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="top"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;file2.csv&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;account;date;balance &lt;/P&gt;&lt;P&gt;acc1;2010-04-01;100401 &lt;/P&gt;&lt;P&gt;acc1;2010-05-02;100502 &lt;/P&gt;&lt;P&gt;acc1;2010-10-03;101003 &lt;/P&gt;&lt;P&gt;acc1;2010-10-04;101004 &lt;/P&gt;&lt;P&gt;acc1;2010-10-05;101005 &lt;/P&gt;&lt;P&gt;acc1;2011-04-01;110401 &lt;/P&gt;&lt;P&gt;acc1;2011-05-02;110502 &lt;/P&gt;&lt;P&gt;acc1;2011-10-03;111003 &lt;/P&gt;&lt;P&gt;&lt;EM&gt;acc1;2011-10-04;111004&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;acc1;2011-10-10;111010 &lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt; account;date;balance &lt;/P&gt;&lt;P&gt; acc2;2010-04-01;200401 &lt;/P&gt;&lt;P&gt; acc2;2010-05-02;200502 &lt;/P&gt;&lt;P&gt; &lt;EM&gt;acc2;2011-10-05;211005&lt;/EM&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, some datapoint do not align (ie. last rows). That means that when I ask for data &lt;STRONG&gt;2011-10-05&lt;/STRONG&gt;, then QV will show me only &lt;STRONG&gt;acc2&lt;/STRONG&gt; (no data for acc1 on 2011-10-05). I would like QV to travel back and find that last value for &lt;EM&gt;acc1 &lt;/EM&gt;was on&lt;EM&gt; 2011-10-04&lt;/EM&gt; and display it (of course it would be best if I could tell this is taken from previous date, but let's focus on getting in working first &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; ). &lt;SPAN style="text-decoration: underline;"&gt;Final effect&lt;/SPAN&gt;: 2011-10-05 shows acc1.balance=111004 and acc1.balance=211005.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[yet another way of defining the question]&lt;/EM&gt; It is the same as displaying data from measurements. One event is polled with hourly frequency, other is polled every second hour, but I always want to see both values, no matter which hour I ask for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the possible?&lt;/P&gt;&lt;P&gt;Or maybe such thing should be approach differently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 09 Oct 2011 15:10:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-10-09T15:10:43Z</dc:date>
    <item>
      <title>Use previous value if no datapoint on given date</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322630#M583808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to see previous value, when there is no data on given date. In other words, I would like QV to assume that value has not changed since last event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example is based on "account balance". Let say we had queried the balance once in a while and we can safely assume there has been no change since last query. I would like to see on the charts the current balance for given date, even if there is no explicit value at this point of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In attached QVW try to select dates 2010-04-01 to 2011-04-01 to see what I mean. (I also attached csv file if you wish to playaround at data level.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any ideas how to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Thx in advance,&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2011 16:04:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322630#M583808</guid>
      <dc:creator />
      <dc:date>2011-10-08T16:04:33Z</dc:date>
    </item>
    <item>
      <title>Use previous value if no datapoint on given date</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322631#M583809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Assuming that you are loading from a csv file - use the file wizard to construct the load statement, and click on "Enable Transformation Step", then select fill an click on the Fill button, select the column to fill, and use the fill condition "is empty", select the "Above" fill type and click OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That adds a filters term to the file type definition which will fill the empty spaces in the selected column with the last non-empty value above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2011 19:07:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322631#M583809</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-10-08T19:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use previous value if no datapoint on given date</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322632#M583810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for quick reply. &lt;/P&gt;&lt;P&gt;This feature is really nice, but it assumes that I have a row (at given date) for both accounts, but second account is just missing balance value (is null).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try and explain the scenario a bit differently.&lt;/P&gt;&lt;P&gt;We have the following tables :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="top"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;file1.csv&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="top"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;file2.csv&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;account;date;balance &lt;/P&gt;&lt;P&gt;acc1;2010-04-01;100401 &lt;/P&gt;&lt;P&gt;acc1;2010-05-02;100502 &lt;/P&gt;&lt;P&gt;acc1;2010-10-03;101003 &lt;/P&gt;&lt;P&gt;acc1;2010-10-04;101004 &lt;/P&gt;&lt;P&gt;acc1;2010-10-05;101005 &lt;/P&gt;&lt;P&gt;acc1;2011-04-01;110401 &lt;/P&gt;&lt;P&gt;acc1;2011-05-02;110502 &lt;/P&gt;&lt;P&gt;acc1;2011-10-03;111003 &lt;/P&gt;&lt;P&gt;&lt;EM&gt;acc1;2011-10-04;111004&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;acc1;2011-10-10;111010 &lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt; account;date;balance &lt;/P&gt;&lt;P&gt; acc2;2010-04-01;200401 &lt;/P&gt;&lt;P&gt; acc2;2010-05-02;200502 &lt;/P&gt;&lt;P&gt; &lt;EM&gt;acc2;2011-10-05;211005&lt;/EM&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, some datapoint do not align (ie. last rows). That means that when I ask for data &lt;STRONG&gt;2011-10-05&lt;/STRONG&gt;, then QV will show me only &lt;STRONG&gt;acc2&lt;/STRONG&gt; (no data for acc1 on 2011-10-05). I would like QV to travel back and find that last value for &lt;EM&gt;acc1 &lt;/EM&gt;was on&lt;EM&gt; 2011-10-04&lt;/EM&gt; and display it (of course it would be best if I could tell this is taken from previous date, but let's focus on getting in working first &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; ). &lt;SPAN style="text-decoration: underline;"&gt;Final effect&lt;/SPAN&gt;: 2011-10-05 shows acc1.balance=111004 and acc1.balance=211005.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[yet another way of defining the question]&lt;/EM&gt; It is the same as displaying data from measurements. One event is polled with hourly frequency, other is polled every second hour, but I always want to see both values, no matter which hour I ask for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the possible?&lt;/P&gt;&lt;P&gt;Or maybe such thing should be approach differently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Oct 2011 15:10:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322632#M583810</guid>
      <dc:creator />
      <dc:date>2011-10-09T15:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Use previous value if no datapoint on given date</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322633#M583811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Bart,&lt;/P&gt;&lt;P&gt;did you solve your issue? If yes please can you share with me on how you solved it?&lt;/P&gt;&lt;P&gt;I am facing a similar issue on financial data on projects. Projects are having values monthly: jan,feb, marc,....dec.&lt;/P&gt;&lt;P&gt;But not necessarily for all months, some projects has values only for some months(The values are actual values)&lt;/P&gt;&lt;P&gt; In fact i need the actual value on quarters (ie march, june, sep and dec) for each project. For projects that have values for all the months, its easy, i just pick value on march, june, sep and dec). &lt;/P&gt;&lt;P&gt;My problem is for project that do not have values for all months. Ex: a project have actuals only for jan and feb, so for this case my quarterly values on march, june, sep adn dec will be my february value because it is the last value i have for this project !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you understand my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you in advance&amp;nbsp; for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 13:30:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322633#M583811</guid>
      <dc:creator />
      <dc:date>2012-06-21T13:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Use previous value if no datapoint on given date</title>
      <link>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322634#M583812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can be done, but its a bit more complex. The steps would be as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Load file1 normally into table tmpData, saving balance as tmpbalance1.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;tmpData:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD account,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; balance as tmpbalance1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM file1.csv (...)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;(Outer) Join file2 to tmpData on account and date, and balance as tmpbalance2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;JOIN (tmpData)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD account,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; balance as tmpbalance2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM file2.csv (...)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Now you have dates and accounts, tmpbalance1 (which contains values that exist in file, null where none) and tmpbalance2 (values that exist in file2, null where none). Finally load the data from tmpData into Data and drop tmpData, like this: &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Data:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD account,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNull(tmpbalance1), If(account = Previous(account), Previous(tmpbalance1)), tmpbalance1) As balance1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNull(tmpbalance2), If(account = Previous(account), Previous(tmpbalance2)), tmpbalance2) As balance2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident tmpData&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Order by account, date;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Drop Table tmpData;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;Note that this will return null for any missing values before the first loaded value for each account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&amp;nbsp; ﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 10:35:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-previous-value-if-no-datapoint-on-given-date/m-p/322634#M583812</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-06-22T10:35:40Z</dc:date>
    </item>
  </channel>
</rss>

