<?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: How to perform a join on dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324743#M119625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't have the solution figured out yet, but working on both of your suggestions. Will post if/when come up with the solution. Thank you! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 May 2011 15:36:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-05-25T15:36:26Z</dc:date>
    <item>
      <title>How to perform a join on dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324739#M119621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone! I’m new to QV, and need a suggestion for the following problem:&lt;/P&gt;&lt;P&gt;I have&amp;nbsp; a table DimTime that I’m loading from one datasource, here is the structure:&lt;/P&gt;&lt;P&gt;Columns:&lt;/P&gt;&lt;P&gt;Day (PK)&lt;/P&gt;&lt;P&gt;Week_Start&lt;/P&gt;&lt;P&gt;Week_End &lt;/P&gt;&lt;P&gt;Month&lt;/P&gt;&lt;P&gt;Quarter &lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I have my Orders table I’m bringing from another datasource, and here is the structure:&lt;/P&gt;&lt;P&gt;OrderID,&lt;/P&gt;&lt;P&gt;StartDate,&lt;/P&gt;&lt;P&gt;Stop Date,&lt;/P&gt;&lt;P&gt;Price&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our orders “run” for a period of time, paying the us the same fixed price each week they are running, so that’s why we have OrderID, StartDate and EndDate.&lt;/P&gt;&lt;P&gt;Now, in order to calculate Revenue for each particular week I need to see what orders were running during that week, in SQL I would do something like:&lt;/P&gt;&lt;P&gt;Select&lt;/P&gt;&lt;P&gt;SUM(Price)&lt;/P&gt;&lt;P&gt;From Orders&lt;/P&gt;&lt;P&gt;Where StartDate &amp;lt;= [Last Day of Week] and (StopDate &amp;gt; [Last Day Of Week&amp;gt;] or StopDate = ‘0000-00-00’)&lt;/P&gt;&lt;P&gt;That will give me all the orders that started running anytime prior or during the week, and were still running after the end of this week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because of that specific, if in QlikView I join my DimTime and Orders table on Day and StartDate, I won’t get the needed result. For each week I need to grab all orders that that started running before or during this week, and continued running after the week ended.&lt;/P&gt;&lt;P&gt;It would be great if anyone could point me in the right direction, it’d be just great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 21:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324739#M119621</guid>
      <dc:creator />
      <dc:date>2011-05-24T21:56:57Z</dc:date>
    </item>
    <item>
      <title>How to perform a join on dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324740#M119622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not following exactly, but I believe that "intervalmatch" is the right direction.&amp;nbsp; Have a look in the help text for that, and let me know if you need more help.&amp;nbsp; I suspect you'll be able to figure it out from there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 22:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324740#M119622</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-24T22:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform a join on dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324741#M119623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest you create a report date on the result of your 2nd query. So you then join your calendar table to that unified report date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿OrderID,&lt;/P&gt;&lt;P&gt;StartDate,&lt;/P&gt;&lt;P&gt;EndDate,&lt;/P&gt;&lt;P&gt;Price,&lt;/P&gt;&lt;P&gt;ReportDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new field report date could be the run date of the reporting or period ending date. I'm sure you can use a sql function and today() to create it.&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;﻿﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 01:30:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324741#M119623</guid>
      <dc:creator />
      <dc:date>2011-05-25T01:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform a join on dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324742#M119624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you both for the suggestions. I'll try to see what I can come up with using your suggestions. Will let you know what worked once I come up with the solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 15:34:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324742#M119624</guid>
      <dc:creator />
      <dc:date>2011-05-25T15:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to perform a join on dates</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324743#M119625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't have the solution figured out yet, but working on both of your suggestions. Will post if/when come up with the solution. Thank you! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 15:36:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-perform-a-join-on-dates/m-p/324743#M119625</guid>
      <dc:creator />
      <dc:date>2011-05-25T15:36:26Z</dc:date>
    </item>
  </channel>
</rss>

