<?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 OR Statement Within Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246946#M582541</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Maybe someting like this:&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;sum(&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;if(&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;TestDate &amp;lt;=DATE(MAX(Island_Date)) and TestDate &amp;gt;=DATE(MIN(Island_Date)-365))&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;and TestType1Flag = 1&amp;nbsp; ,1 , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;if(TestDate &amp;lt;=DATE(MAX(Island_Date)) and TestDate &amp;gt;=DATE(MIN(Island_Date)-5*365))&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;and Test2TypeFlag = 1 ,1 ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;if(TestDate &amp;lt;=DATE(MAX(Island_Date)) and TestDate &amp;gt;=DATE(MIN(Island_Date)-10*365))&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;and Test3TypeFlag = 1,1,0&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;)&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;You can only do this if you are sure that every row shows only one patient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;succes!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Nov 2011 13:02:07 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-11-22T13:02:07Z</dc:date>
    <item>
      <title>OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246945#M582539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I’m trying to create a chart that shows (by physician) what % of their patients had a certain test completed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fun part is that to qualify as having this test completed, a patient can fall into 1 (or more) of the following buckets:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;TestType1Flag = 1 and TestDate within the last year&lt;/LI&gt;&lt;LI&gt;Test2TypeFlag = 1 and TestDate within the last 5 years&lt;/LI&gt;&lt;LI&gt;Test3TypeFlag = 1 and TestDate within the last 10 years&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, the time frame is selected by the end-user (Island_Date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, my chart has Dimension = Physician and the Expression is below.&amp;nbsp; The expression works, but if – for example – a patient had Test1 and Test2 in the correct time frames…&amp;nbsp; this patient is counted twice.&amp;nbsp; I understand why this is happening – I’m just unsure how to correct it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count (&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;/P&gt;&lt;P&gt;TestDate ={"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-365))"}&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;TestType1Flag = {1}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;DISTINCT Patient)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;Count (&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;/P&gt;&lt;P&gt;TestDate ={"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-5*365))"}&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;Test2TypeFlag = {1}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;DISTINCT Patient)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count (&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;/P&gt;&lt;P&gt;TestDate ={"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-10*365))"}&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;Test3TypeFlag = {1}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;DISTINCT Patient)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 12:48:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246945#M582539</guid>
      <dc:creator />
      <dc:date>2011-11-22T12:48:57Z</dc:date>
    </item>
    <item>
      <title>OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246946#M582541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Maybe someting like this:&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;sum(&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;if(&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;TestDate &amp;lt;=DATE(MAX(Island_Date)) and TestDate &amp;gt;=DATE(MIN(Island_Date)-365))&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;and TestType1Flag = 1&amp;nbsp; ,1 , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;if(TestDate &amp;lt;=DATE(MAX(Island_Date)) and TestDate &amp;gt;=DATE(MIN(Island_Date)-5*365))&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;and Test2TypeFlag = 1 ,1 ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;if(TestDate &amp;lt;=DATE(MAX(Island_Date)) and TestDate &amp;gt;=DATE(MIN(Island_Date)-10*365))&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;and Test3TypeFlag = 1,1,0&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;)&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;You can only do this if you are sure that every row shows only one patient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;succes!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 13:02:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246946#M582541</guid>
      <dc:creator />
      <dc:date>2011-11-22T13:02:07Z</dc:date>
    </item>
    <item>
      <title>OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246947#M582542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At first glance, I think you need to specify time intervals that don't overlap in your sets, like (for the second part of the sum):&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;Count (&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;/P&gt;&lt;P&gt;TestDate ={"&lt;STRONG&gt;&amp;lt;$(=DATE(Min(Island_Date)-365))&lt;/STRONG&gt;&amp;gt;=$(=DATE(MIN(Island_Date)-5*365))"}&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;Test2TypeFlag = {1}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;DISTINCT Patient)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 13:05:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246947#M582542</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-22T13:05:44Z</dc:date>
    </item>
    <item>
      <title>OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246948#M582543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A patient could have had Test2TypeFlag = 1 in the most recent year...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 13:28:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246948#M582543</guid>
      <dc:creator />
      <dc:date>2011-11-22T13:28:05Z</dc:date>
    </item>
    <item>
      <title>OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246949#M582544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this, but it doesn't seem to be working...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 13:31:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246949#M582544</guid>
      <dc:creator />
      <dc:date>2011-11-22T13:31:04Z</dc:date>
    </item>
    <item>
      <title>OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246950#M582545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, sorry, I missed the different TestTypes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hm, maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count (&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;/P&gt;&lt;P&gt;TestDate = ({"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-365))"}*p({&amp;lt;TestType1Flag = {1} &amp;gt;}))&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;({"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-5*365))"}*p({&amp;lt;Test2TypeFlag = {1}&amp;gt;})&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;({"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-10*365))"}*p({&amp;lt;Test3TypeFlag = {1}&amp;gt;})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DISTINCT Patient)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 13:38:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246950#M582545</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-22T13:38:57Z</dc:date>
    </item>
    <item>
      <title>OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246951#M582546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; This returns a result...&amp;nbsp; But it's still counting patients more than once.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 13:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246951#M582546</guid>
      <dc:creator />
      <dc:date>2011-11-22T13:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246952#M582547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure? Since we use a distinct Patient count in one single count function, I can't think of how this could be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you maybe create a small sample app and upload it here (upload is available via advanced editor)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 17:02:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246952#M582547</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-22T17:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: OR Statement Within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246953#M582548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about using three set modifiers in the same set analysis so what is counted in one case is not in the others? Something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Count (&lt;/P&gt;&lt;P&gt;{&amp;lt;&lt;/P&gt;&lt;P&gt;TestDate ={"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-365))"}&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;TestType1Flag = {1}&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&amp;lt;&lt;/P&gt;&lt;P&gt;TestDate ={"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-5*365))"}&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;Test2TypeFlag = {1}&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;&amp;lt;&lt;/P&gt;&lt;P&gt;TestDate ={"&amp;lt;=$(=DATE(MAX(Island_Date)))&amp;gt;=$(=DATE(MIN(Island_Date)-10*365))"}&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;Test3TypeFlag = {1}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;DISTINCT Patient)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The set analysis is considerably higher, but the different set modifiers are in the same expression and summed using the "+" set operator (logic OR).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.grupocomex.com"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 17:52:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/OR-Statement-Within-Set-Analysis/m-p/246953#M582548</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-11-22T17:52:52Z</dc:date>
    </item>
  </channel>
</rss>

