<?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: Count with AND &amp; NOT Selections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433352#M430854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;But, how can i get count based on the logic &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Count(Distinct EPCRID)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think there is any way to override the Not selection only. Set analysis overrides the selections on a field, but it does not differentiate between the individual parts of an AND selection. The counts could be like this'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;Count({&amp;lt;EPCRID = P({&amp;lt;Drug = {'Drug2'}&amp;gt;} EPCRID)&amp;gt;} Distinct EPCRID)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt; Count({&amp;lt;Drug = {'Drug2'}&amp;gt;} Distinct EPCRID)&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Count({&amp;lt;EPCRID = P({&amp;lt;Drug = {'Drug2'}&amp;gt;} EPCRID) * E({&amp;lt;Drug = {'Drug5'}&amp;gt;} EPCRID)&amp;gt;} Distinct EPCRID)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Nov 2017 07:07:01 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2017-11-09T07:07:01Z</dc:date>
    <item>
      <title>Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433342#M430844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a AND-mode selection requirement where I have to implement AND-mode in List Box as in &lt;A href="https://community.qlik.com/thread/62060"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a little description on this:&lt;/P&gt;&lt;P&gt;If I have patients Sam, John, Antony and Alex as show in the data below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to show a patient who had multiple drugs at a time but not just the one selected.&lt;/P&gt;&lt;P&gt;For example: If I want to see a patient who had Drug2 AND Drug5, I should see John and Antony only&lt;/P&gt;&lt;P&gt;but not Sam or Peter(though they had Drug2 OR Drug5, my requirement is to show only those who had both the drugs)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; EPCRID, Patient, Drug&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12345, Sam, Drug1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12345, Sam, Drug2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12345, Sam, Drug3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12345, Sam, Drug4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 54321, John, Drug2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 54321, John, Drug5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 98765, Antony, Drug2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 98765, Antony, Drug4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 98765, Antony, Drug5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22222, Peter, Drug4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22222, Peter, Drug5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 99999, Alex, Drug4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To acheive this I have implemented the AND-mode join in the load script. Please find the attached QVW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, now my requirement is&lt;/P&gt;&lt;P&gt;1) To show count of patients with selected drug. in this case the count should ignore the NOT(excluded brown color) selections&lt;/P&gt;&lt;P&gt;For example: AndMode Selection = &amp;amp;Drug2, !Drug5 Result = Count of patients who had Drug2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) To show count of patients with selected drug and considering not having excluded(NOT) drug&lt;/P&gt;&lt;P&gt;For example: &lt;SPAN style="font-size: 13.3333px;"&gt;AndMode Selection = &amp;amp;Drug2, !Drug5 Result = Count of patients who had Drug2 but did not had Drug5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Can I achieve this? &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Shyam&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 02:21:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433342#M430844</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-08T02:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433343#M430845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Experts, Can I please get some help here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 05:28:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433343#M430845</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-09T05:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433344#M430846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;‌ one who can help you better with expressions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 05:42:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433344#M430846</guid>
      <dc:creator>shraddha_g</dc:creator>
      <dc:date>2017-11-09T05:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433345#M430847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess it's working fine.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/182634_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Patient (ID) who bought 'Drug2' are - &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;12345&lt;/SPAN&gt;,&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; 54321&lt;/SPAN&gt; and 98765&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Patient (ID) who bought 'Drug5' are -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; 54321&lt;/SPAN&gt; and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;98765 and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;22222&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Hence who bought 'Drug2' and NOT 'Drug5' is &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;12345&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 05:43:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433345#M430847</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-11-09T05:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433346#M430848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tresesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is something like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;However, now my requirement is&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1) To show count of patients with selected drug. in this case the count should ignore the NOT(excluded brown color) selections&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;For example: AndMode Selection = &amp;amp;Drug2, !Drug5 Result = Count of patients who had Drug2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;2) To show count of patients with selected drug and considering not having excluded(NOT) drug&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;For example: &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;AndMode Selection = &amp;amp;Drug2, !Drug5 Result = Count of patients who had Drug2 but did not had Drug5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 05:46:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433346#M430848</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-09T05:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433347#M430849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the expected output against the current selection?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 05:51:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433347#M430849</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-11-09T05:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433348#M430850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Current Selections = &amp;amp;Drug2, !Drug4&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1) To show count of patients with selected drug. in this case the count should ignore the NOT(excluded brown color) selections&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;For example: AndMode Selection = &amp;amp;Drug2, !Drug5 Result = Count of patients who had Drug2&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt; Result for this based on current selection is 3 (Sam, John, Antony)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;2) To show count of patients with selected drug and considering not having excluded(NOT) drug&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;For example: &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;AndMode Selection = &amp;amp;Drug2, !Drug5 Result = Count of patients who had Drug2 but did not had Drug5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: inherit;"&gt;&lt;STRONG&gt; Result for this based on current selection is 1 (John)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 05:55:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433348#M430850</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-09T05:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433349#M430851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your second requirement :&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/182635_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;For first : You mean you want to ignore the 'NOT Selection' ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 06:07:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433349#M430851</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-11-09T06:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433350#M430852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;For first : You mean you want to ignore the 'NOT Selection' ? &lt;/SPAN&gt;&lt;STRONG&gt;Yes&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 06:13:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433350#M430852</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-09T06:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433351#M430853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tresesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry. I don't meant to be rude here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;.&lt;/P&gt;&lt;P&gt;But, how can i get count based on the logic you provided for the second requirement?&lt;/P&gt;&lt;P&gt;Also, a patient could have more than one EPCRID when he visits hospital again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to count the EPCRID rather the patient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 06:21:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433351#M430853</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-09T06:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433352#M430854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;But, how can i get count based on the logic &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Count(Distinct EPCRID)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think there is any way to override the Not selection only. Set analysis overrides the selections on a field, but it does not differentiate between the individual parts of an AND selection. The counts could be like this'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;Count({&amp;lt;EPCRID = P({&amp;lt;Drug = {'Drug2'}&amp;gt;} EPCRID)&amp;gt;} Distinct EPCRID)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt; Count({&amp;lt;Drug = {'Drug2'}&amp;gt;} Distinct EPCRID)&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Count({&amp;lt;EPCRID = P({&amp;lt;Drug = {'Drug2'}&amp;gt;} EPCRID) * E({&amp;lt;Drug = {'Drug5'}&amp;gt;} EPCRID)&amp;gt;} Distinct EPCRID)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 07:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433352#M430854</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-11-09T07:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433353#M430855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use &lt;EM&gt;&lt;STRONG&gt;Count( Distinct &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;EPCRID &lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/EM&gt; that should take care of the cases when a patient would have multiple visits. However, for first requirement: I guess it would be difficult (if not impossible) to ignore the 'NOT Selection'. Because I don't know a method to separate out 'AND Selection' and 'NOT Selection' here. You can probably use alternate state to handle this requirement. Refer &lt;A href="https://community.qlik.com/qlik-users/14602"&gt;vgutkovsky&lt;/A&gt;‌'s proposed solution for a clue in the post you referred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 07:08:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433353#M430855</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-11-09T07:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433354#M430856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this for the first req:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT {&amp;lt;Drug = {$(=Replace(RTrim(Replace(Replace(Replace(SubField(GetFieldSelections(andDrug), '!', 1), ',', Chr(39) &amp;amp; ',' &amp;amp; Chr(39)), '&amp;amp;', Chr(39)), ',' &amp;amp; Chr(39), '&amp;nbsp;&amp;nbsp;&amp;nbsp; ')), '&amp;nbsp;&amp;nbsp;&amp;nbsp; ', ','))}, andDrug&amp;gt;} Patient)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/182759_Capture.PNG" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I tried to trim down your selections and not selections&lt;/P&gt;&lt;P&gt;selections -&amp;gt; &amp;amp;&lt;/P&gt;&lt;P&gt;not selections -&amp;gt; !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From there onward it was mostly getting it into a format which can be used in set analysis.... may be there is a better way to do this string manipulation, but this was the best I was able to come up with..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 17:46:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433354#M430856</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-09T17:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433355#M430857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did not work much on NOT and AND mode selections. I never realized that getfieldselections() could return the field values with '&amp;amp;' and '!' indicators. That's a good notice and solution accordingly. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I try few things with this, it looks very different in behavior (other than the selection logic).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;GetSelectedCount(Field) for one &amp;amp;selection and one !selection gives 1 as output&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="182788" alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/182788_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;while Count(Distinct Field) gives 4&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;IMG __jive_id="182789" alt="Capture2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/182789_Capture2.JPG" style="height: auto;" /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you explain this &lt;SPAN style="font-size: 13.3333px;"&gt;behavior&lt;/SPAN&gt; ? Sorry, if this is already documented somewhere, I did not come across.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2017 05:12:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433355#M430857</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-11-10T05:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433356#M430858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK Count() function usually counts all the possible (and available) selections. In this case Count(DISTINCT andDrug) is counting Drug1, Drug2, Drug3, and Drug4. Whereas GetSelectedCount(), counts this which are directly selected in the field. In this case, although we have two selections (selection and not selection), it appears to be counting the selection only, I believe (don't know why).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best case to see the difference between Count(DISTINCT) and GetSelectedCount() is when no selection has been made. Count(DISTINCT) will count DISTINCT will show the distinct count of the field, whereas GetSelectedCount will show 0 because you have not selected anything in the field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if I answered what you asked for, but even I am not 100% sure about the behavior. May be &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;hic&lt;/A&gt;‌ can share his insights.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2017 12:29:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433356#M430858</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-10T12:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433357#M430859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny's answer is pretty much it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count(distinct ...) counts all possible values - which is different from the selected ones. A field value can be selected without being possible. See &lt;A href="https://community.qlik.com/qlik-blogpost/2907"&gt;Colors, States and State vectors&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then we have the field functions that operate on the symbol tables and count the values in the different states :&lt;/P&gt;&lt;P&gt;GetSelectedCount()&lt;/P&gt;&lt;P&gt;GetAlternativeCount()&lt;/P&gt;&lt;P&gt;GetPossibleCount()&lt;/P&gt;&lt;P&gt;GetExcludedCount()&lt;/P&gt;&lt;P&gt;GetNotSelectedCount()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, the &lt;SPAN style="font-size: 13.3333px;"&gt;GetSelectedCount&lt;/SPAN&gt; only counts the the positive (green) selections. To count the red ones you should use &lt;SPAN style="font-size: 13.3333px;"&gt;GetNotSelectedCount&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2017 13:08:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433357#M430859</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2017-11-10T13:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433358#M430860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton for all your responses in helping me find the solution.&lt;/P&gt;&lt;P&gt;It a great help for me indeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sunny, thanks heaps for the formula. I am going to try it out and will post the output.&lt;/P&gt;&lt;P&gt;Appreciate a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Shyam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Nov 2017 13:24:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433358#M430860</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-11T13:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433359#M430861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your time and help here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried your formula and it is working well when there are AND &amp;amp; NOT selections in the andDrug field.&lt;/P&gt;&lt;P&gt;But, it does not work when NOT selection is not made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it how it will work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 02:58:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433359#M430861</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-13T02:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433360#M430862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, it looks like its not working when I select two AND values (along with a NOT) as shown in the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attached QVW, I have selected Drug2 AND Drug4 along with a NOT Drug3.&lt;/P&gt;&lt;P&gt;The result ignoring the NOT selection should be = 2 as there are two patients sam and Antony who had both the drugs &lt;SPAN style="font-size: 13.3333px;"&gt;Drug2 AND Drug4.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;But the output is 5.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Any idea how can this be fixed?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks again.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 03:14:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433360#M430862</guid>
      <dc:creator>shyamcharan</dc:creator>
      <dc:date>2017-11-13T03:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count with AND &amp; NOT Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433361#M430863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny, HIC,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I notice that even if one is selected (green) few are there in white (possible). This is not the case very often we see in general selection and so I got confused. And yes - the GetNotSelectedCount() answers and clears the actual doubt. Thanks you both once again. Few things are clearer now. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 04:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-with-AND-NOT-Selections/m-p/1433361#M430863</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-11-13T04:57:23Z</dc:date>
    </item>
  </channel>
</rss>

