<?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: Set Analysis: Date Comparison Two Fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339368#M1169596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your table chart with dimensions Hospital Nr, Event One Date and Event Two Date, just use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum(if([Event One Date] &amp;lt;= [Event Two Date]+7 and&amp;nbsp; [Event One Date]&amp;gt;= [Event Two Date]-7,1,0))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can replace the 7 with a variable and set the variable in a slider / input box.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Aug 2012 11:44:52 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-08-06T11:44:52Z</dc:date>
    <item>
      <title>Set Analysis: Date Comparison Two Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339365#M1169593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been searching on the community and have found similar examples but nothing that will quite do what I require.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am stuck with a set analysis (or If statement) expression using dates from two feilds. What I Require is:&lt;/P&gt;&lt;P style="text-indent: -18pt;"&gt;&lt;SPAN class="pasted-list-info"&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;/SPAN&gt;To flag all the ‘hospital numbers’ that have a ‘Event One Date’ within 7 days of the ‘Event Two date’. This could be seven days before or seven days after.&lt;/P&gt;&lt;P style="text-indent: -18pt;"&gt;&lt;SPAN class="pasted-list-info"&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;/SPAN&gt;There is also the added complication that there could be multiple ‘Event One’ or ‘Event Two’ for each hospital number. Where this is the case&amp;nbsp; we would want it to compare any ‘Event One Date +/- 7 days’ to any ‘Event Two Date’.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where have I got to?&lt;/P&gt;&lt;P&gt; - Currently not very far!!! In the attached example I have just been trying to flag Hospital Numbers where Event one/two dates are equal. I was going to build on the expression from there however I am even having trouble doing this. &lt;/P&gt;&lt;P&gt; - What I am thinking is that for each hospital number we would first need to create a set of all the possible ‘Event One Dates’ we then need&amp;nbsp; to look for the intersection with the ‘Event Two Dates’. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see attached an Example file to play aorund with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated and I am really looking forward to increasing my understanding of how this would work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 09:03:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339365#M1169593</guid>
      <dc:creator />
      <dc:date>2012-08-06T09:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Date Comparison Two Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339366#M1169594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your right, your problem in the second table is due to the fact, that the set expression is evaluated once per chart.&lt;/P&gt;&lt;P&gt;Not sure if you can create a set expression for what you want to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can probably work out a solution with advanced aggregation (aggr() function and some conditionals).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed a different approach, creating an interval match in the load script. Not sure if this fits your needs, but maybe give you an idea on how to solve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 10:04:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339366#M1169594</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-06T10:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Date Comparison Two Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339367#M1169595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stefan. That is a good back up option and could be expanded to work for 'n' fields. Ideally though I would do it using set analysis or IF statement so i can let users input the numbers of days between events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you or anyone else has further ideas that would be great. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 11:33:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339367#M1169595</guid>
      <dc:creator />
      <dc:date>2012-08-06T11:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Date Comparison Two Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339368#M1169596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your table chart with dimensions Hospital Nr, Event One Date and Event Two Date, just use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum(if([Event One Date] &amp;lt;= [Event Two Date]+7 and&amp;nbsp; [Event One Date]&amp;gt;= [Event Two Date]-7,1,0))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can replace the 7 with a variable and set the variable in a slider / input box.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 11:44:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339368#M1169596</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-06T11:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Date Comparison Two Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339369#M1169597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. This is definitly getting closer. The only problem here is it doesnt seem to check for all the possible dates for that hospital number. In the example attached i have extended it to 400 days but this is not picking it up. I think this is because it has the event one and event two dates on different lines in the table. Any ideas on hwo to get around this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 11:54:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339369#M1169597</guid>
      <dc:creator />
      <dc:date>2012-08-06T11:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Date Comparison Two Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339370#M1169598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to remove the intervalmatch from your load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//JOIN IntervalMatch ([Event One Date], [Hospital Number]) LOAD [Event Two Start], [Event Two End], [Hospital Number] Resident TAB2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 11:59:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339370#M1169598</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-06T11:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Date Comparison Two Fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339371#M1169599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan,&lt;/P&gt;&lt;P&gt;Did you finally find a solution to your problem ? I'm very interested as we face a similar problem comparing multiple events in a process and looking for events occuring within a time span of x days.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 22:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Date-Comparison-Two-Fields/m-p/339371#M1169599</guid>
      <dc:creator>mark_casselman</dc:creator>
      <dc:date>2013-06-24T22:17:56Z</dc:date>
    </item>
  </channel>
</rss>

