<?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: Chart with different dates and calculations between those two date records in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994652#M338614</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further to this post, with the use of variables (date1 and date2) I am able to calculate (BID1 + BID2)/2, however I am required to, if there is no record for the "variable" date, find the closes date in the past which does exist for the DIM.&lt;/P&gt;&lt;P&gt;I tried something like this:&lt;/P&gt;&lt;P&gt;max(if(DATE = date(max(if(DATE &amp;lt;= '$(date1)',DATE))),BID,null()))&lt;/P&gt;&lt;P&gt;However I can not perform multiple or sub aggregations in the current aggregations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is, how can I check for the closest existing date record to the specified variable date ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Edwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Oct 2015 11:38:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-20T11:38:39Z</dc:date>
    <item>
      <title>Chart with different dates and calculations between those two date records</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994649#M338611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table which looks as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BID Price&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ASK Price&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015/10/01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.73236&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.7255&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015/10/02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015/10/03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.7435&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.744&lt;/P&gt;&lt;P&gt;DEF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015/10/01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.23434&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.2983&lt;/P&gt;&lt;P&gt;DEF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015/10/02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.2355&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.30121&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user would like to select different dates, i.e. a start and end date.&amp;nbsp; From these dates I need to perform a calculation on for example the BID prices.&lt;/P&gt;&lt;P&gt;Therefore if ABC is selected and dates i Oct 2015 and 3 Oct 2015, then I need to show a calculation like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New desired chart:&lt;/P&gt;&lt;P&gt;NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BID Price 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BID Price 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (BID1 + BID2) /2&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.73236&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.7435&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.73793&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's easy to do this in a static SQL but not so strait forward in QlikView with dynamic start &amp;amp; end dates...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then also if at all possible it should also be able to manage null values and possibly get the closest date with values... but maybe lets focus on one problem first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your assistance would be highly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 08:59:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994649#M338611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T08:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Chart with different dates and calculations between those two date records</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994650#M338612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will collect the dates as input variables from the user (lets day date from to date to)... compare this will the existing date field and then have a avg(sum by name)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy to Help&lt;/P&gt;&lt;P&gt;Sreeni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 09:04:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994650#M338612</guid>
      <dc:creator>SreeniJD</dc:creator>
      <dc:date>2015-10-16T09:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Chart with different dates and calculations between those two date records</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994651#M338613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you JD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 10:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994651#M338613</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-16T10:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Chart with different dates and calculations between those two date records</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994652#M338614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further to this post, with the use of variables (date1 and date2) I am able to calculate (BID1 + BID2)/2, however I am required to, if there is no record for the "variable" date, find the closes date in the past which does exist for the DIM.&lt;/P&gt;&lt;P&gt;I tried something like this:&lt;/P&gt;&lt;P&gt;max(if(DATE = date(max(if(DATE &amp;lt;= '$(date1)',DATE))),BID,null()))&lt;/P&gt;&lt;P&gt;However I can not perform multiple or sub aggregations in the current aggregations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is, how can I check for the closest existing date record to the specified variable date ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Edwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2015 11:38:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-with-different-dates-and-calculations-between-those-two/m-p/994652#M338614</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-20T11:38:39Z</dc:date>
    </item>
  </channel>
</rss>

