<?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 How can I show a set of matching records between two dates when users can select any date combination? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168599#M39697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno,&lt;/P&gt;&lt;P&gt;Thanks for the reply. I get the building of a table of all possible dates and joining that to the master table. It's your final bit of the solution that I'm not sure about.&lt;/P&gt;&lt;P&gt;You're explicitly putting in the load all dates &amp;gt;= start date and &amp;lt;= leave date. I can't do this as users can change this in the app to pick any combination of months and even years. So I don't know at the load point what dates are going to be picked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Mar 2011 12:45:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-18T12:45:35Z</dc:date>
    <item>
      <title>How can I show a set of matching records between two dates when users can select any date combination?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168597#M39695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have a set of people on our system who have a start date and a leave date. Our users want to see who was "live" at any point in the past, based on month and year combinations. They also want the data broken down by month/year.&lt;/P&gt;&lt;P&gt;I can't think of a way to do this, as they could pick (for example) 2010 May, June and October and 2011 January. So the chart would need to show those four months only (not a problem), but also show the people who were live in those months based on their start/end date.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 11:32:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168597#M39695</guid>
      <dc:creator />
      <dc:date>2011-03-18T11:32:53Z</dc:date>
    </item>
    <item>
      <title>How can I show a set of matching records between two dates when users can select any date combination?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168598#M39696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First you will need to create all possible dates between the lowest date (in both fields - start and leave date) and highiest date (in both of them to);&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;TableXXX:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;PersonID,&lt;/P&gt;&lt;P&gt;StartDate,&lt;/P&gt;&lt;P&gt;LeaveDate;&lt;/P&gt;&lt;P&gt;SQL Select xxxxxxxxx From yyyyyy;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[MinDate]:&lt;/P&gt;&lt;P&gt;Load Min(StartDate) as MinStartDate&lt;/P&gt;&lt;P&gt;Resident TableXXX;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[MaxDate]:&lt;/P&gt;&lt;P&gt;Load Max(LeaveDate) as MaxLeaveDate&lt;/P&gt;&lt;P&gt;Resident TableXXX;&lt;/P&gt;&lt;P&gt;// YYYY-MM-DD = ISO standard format for dates (most compatible)&lt;/P&gt;&lt;P&gt;Let Var_MinDate = Date(Peek('MinStartDate', 0, 'MinDate'), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;Let Var_MaxDate = Date(Peek('MaxLeaveDate', 0, 'MaxDate'), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;Drop tables MinDate, MaxDate;&lt;/P&gt;&lt;P&gt;//Now you have the highiest and the lowest dates... you will need to fill this interval.&lt;/P&gt;&lt;P&gt;// Example&lt;/P&gt;&lt;P&gt;[DATESBETWEEN]:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;'$(Var_MinDate)' + RowNo() as [Dates]&lt;/P&gt;&lt;P&gt;AutoGenerate($(Var_MaxDate) - $(Var_MinDate));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Now You have a Table DATESBETWEEN With all possible dates. Now you will make a Cartesian product of DATESBETWEEN and TableXXX.&lt;/P&gt;&lt;P&gt;join (TableXXX)&lt;/P&gt;&lt;P&gt;Load Dates&lt;/P&gt;&lt;P&gt;Resident DATESBETWEEN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table DATESBETWEE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//And finally, you wil need to filter your Cartesian Product (on TableXXX) between the StartDate and LeaveDate;&lt;/P&gt;&lt;P&gt;//Example&lt;/P&gt;&lt;P&gt;[TableResult]:&lt;/P&gt;&lt;P&gt;Load * Resident TableXXX Where Dates &amp;gt;= StartDate and Dates &amp;lt;= LeaveDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table TableXXX;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thats the idea... In the end, the table 'TableResult' will have the time between the start and leave date.&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 12:26:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168598#M39696</guid>
      <dc:creator />
      <dc:date>2011-03-18T12:26:06Z</dc:date>
    </item>
    <item>
      <title>How can I show a set of matching records between two dates when users can select any date combination?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168599#M39697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno,&lt;/P&gt;&lt;P&gt;Thanks for the reply. I get the building of a table of all possible dates and joining that to the master table. It's your final bit of the solution that I'm not sure about.&lt;/P&gt;&lt;P&gt;You're explicitly putting in the load all dates &amp;gt;= start date and &amp;lt;= leave date. I can't do this as users can change this in the app to pick any combination of months and even years. So I don't know at the load point what dates are going to be picked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 12:45:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168599#M39697</guid>
      <dc:creator />
      <dc:date>2011-03-18T12:45:35Z</dc:date>
    </item>
    <item>
      <title>How can I show a set of matching records between two dates when users can select any date combination?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168600#M39698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, thats why we needed to make a cartesian product and, after that, make a filter explicitaly like you said, filling the intervals of start and leave dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) You Had:&lt;/P&gt;&lt;P&gt;TempXXX&lt;/P&gt;&lt;P&gt;People StartDate LeaveDate&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03&lt;/P&gt;&lt;P&gt;Peter 2010-01-02 2010-01-02&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) We made dates between the min(StartDate) = 2010-01-01 and Max(LeaveDate) = 2010-01-05&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates&lt;/P&gt;&lt;P&gt;2010-01-01&lt;/P&gt;&lt;P&gt;2010-01-02&lt;/P&gt;&lt;P&gt;2010-01-03&lt;/P&gt;&lt;P&gt;2010-01-04&lt;/P&gt;&lt;P&gt;2010-01-05&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Then we joinned with the master table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempXXX&lt;/P&gt;&lt;P&gt;People StartDate LeaveDate Dates&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03 2010-01-01&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03 2010-01-02&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03 2010-01-03&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03 2010-01-04&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03 2010-01-05&lt;/P&gt;&lt;P&gt;Peter 2010-01-02 2010-01-02 2010-01-01&lt;/P&gt;&lt;P&gt;Peter 2010-01-02 2010-01-02 2010-01-02&lt;/P&gt;&lt;P&gt;Peter 2010-01-02 2010-01-02 2010-01-03&lt;/P&gt;&lt;P&gt;Peter 2010-01-02 2010-01-02 2010-01-04&lt;/P&gt;&lt;P&gt;Peter 2010-01-02 2010-01-02 2010-01-05&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-01&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-02&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-03&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-04&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-05&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Then we explicitly filter the field "Dates" between the StartDate and LeaveDate (Dates &amp;gt;= StartDate and Dates &amp;lt;= LeaveDate)&lt;/P&gt;&lt;P&gt;And we will have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempXXX&lt;/P&gt;&lt;P&gt;People StartDate LeaveDate Dates&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03 2010-01-01&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03 2010-01-02&lt;/P&gt;&lt;P&gt;John 2010-01-01 2010-01-03 2010-01-03&lt;/P&gt;&lt;P&gt;Peter 2010-01-02 2010-01-02 2010-01-02&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-02&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-03&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-04&lt;/P&gt;&lt;P&gt;Mary 2010-01-02 2010-01-05 2010-01-05&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After doing what I suggested, you would use the field "Dates" often StartDate or LeaveDate in the layout...&lt;/P&gt;&lt;P&gt;if someone select 2010-01-02 it will show that John, Mary and Peter was live..&lt;/P&gt;&lt;P&gt;If someone select 2010-01-01 and 2010-01-03 it will show that John, Mary was live.. not Peter because he wont...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wasn't that the main problem? If not, sorry... I'd understand wrong...&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 20:17:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168600#M39698</guid>
      <dc:creator />
      <dc:date>2011-03-18T20:17:59Z</dc:date>
    </item>
    <item>
      <title>How can I show a set of matching records between two dates when users can select any date combination?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168601#M39699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you have a Calendar with dates or Months that the users can select... You could link the Date from the Calendar with the pairs of Start/Leave Dates using INTERVALMATCH (if it doesn't interfere with the rest of your data model). If you can do that, the rest will happen auto-magically &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 20:24:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-show-a-set-of-matching-records-between-two-dates-when/m-p/168601#M39699</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-03-18T20:24:18Z</dc:date>
    </item>
  </channel>
</rss>

