<?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: And/Or Subset of Objects in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415524#M1157028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I added in a distinct to the count for OR selection.&amp;nbsp; Take a look and see if it helps at all.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Feb 2013 21:24:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-02-08T21:24:59Z</dc:date>
    <item>
      <title>And/Or Subset of Objects</title>
      <link>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415518#M1157022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am fairly new to QlikView, and I have a requirement I can't seem to figure out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to give users the option to AND or OR a list of object selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a simplified list of the objects:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Listbox - Drug&lt;/P&gt;&lt;P&gt;Listbox - DiagnosisCode&lt;/P&gt;&lt;P&gt;Listbox - Procedure&lt;/P&gt;&lt;P&gt;Date Range - Date&lt;/P&gt;&lt;P&gt;Listbox - Gender&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(The first four are in a single table.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to be able to allow users to choose whether or AND or OR the first three while always applying the last two.&lt;/P&gt;&lt;P&gt;The first three are each in their own alternate state group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My plan was to create a variable that can be set to 1 or 0 to indicate whether the first three should be ANDed or ORed, and then use set analysis to generate the counts that are used in all of my graphs.&lt;/P&gt;&lt;P&gt;(All calculations are counts based on distinct member ID.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a couple of issues. I cant' seem to figure out how to get a selection to be used in set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a sample of what I was trying for the OR logic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; count({$&amp;lt;Drug={Drug}&amp;gt;} DISTINCT MemberID)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; count({$&amp;lt;DiagnosisCode={DiagnosisCode}&amp;gt;} DISTINCT MemberID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I realize that this is probably just searching for the literal names, rather than the selected values from the fields with those names.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm also not sure how to apply all of the other filters to the set of ANDed or ORed items.&lt;/P&gt;&lt;P&gt;How can I say (for the OR scenario):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set of items filtered excluding Drug, DiagnosisCode, Procedure selections&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; that also exist (intersect) with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set of items that contain selected Drug(s) OR DiagnosisCode(s) OR Procedure(s)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AND scenario is (I think) simple, because that's just how QlikView works out of the box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;Bret&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 16:18:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415518#M1157022</guid>
      <dc:creator />
      <dc:date>2013-02-07T16:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: And/Or Subset of Objects</title>
      <link>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415519#M1157023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It occurs to me that I could do something like this (again, for the OR):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({[MainState] * ([DrugState] + [DiagnosisState] + [ProcedureState])} DISTINCT MemberID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any reason this wouldn't work, if all of the "other" filters I wanted to apply were in the MainState alternate state?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 16:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415519#M1157023</guid>
      <dc:creator />
      <dc:date>2013-02-07T16:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: And/Or Subset of Objects</title>
      <link>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415520#M1157024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if this is kind of what you are looking for.&amp;nbsp; I used island fields that mimic your true fields for the 'OR' option.&amp;nbsp; Let me know if anything doesn't make sense with it.&amp;nbsp; Hope it helps. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 17:37:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415520#M1157024</guid>
      <dc:creator />
      <dc:date>2013-02-07T17:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: And/Or Subset of Objects</title>
      <link>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415521#M1157025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems to be close, although I can't get the logic to work when applying it to a pie chart of gender while ORing (see attached file).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help, I really appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bret&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 19:51:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415521#M1157025</guid>
      <dc:creator />
      <dc:date>2013-02-07T19:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: And/Or Subset of Objects</title>
      <link>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415522#M1157026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to add a Sum().&amp;nbsp; See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 20:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415522#M1157026</guid>
      <dc:creator />
      <dc:date>2013-02-07T20:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: And/Or Subset of Objects</title>
      <link>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415523#M1157027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data is actually a little different than I explained. I was hoping to avoid confusion in my explanation, but the differences matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the data table, a given member will only have either a drug, a diagnosis or a procedure.&lt;/P&gt;&lt;P&gt;Additionally demographic information about members is stored in another table. There are multiple records per member in this table because it contains other information about the period during which the member was covered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because of this structure, I've run into a couple of problems when trying to implement your solution (probably due to my ignorance):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When using AND multiple ANDed selections cannot be selected&lt;/LI&gt;&lt;LI&gt;When using OR, the counts are off (this isn't a problem with AND because I was able to add DISTINCT to COUNT)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're able to provide some information on how to apply your solution to my real schema, I'd be very appreciative.&lt;/P&gt;&lt;P&gt;I've attached an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 15:46:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415523#M1157027</guid>
      <dc:creator />
      <dc:date>2013-02-08T15:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: And/Or Subset of Objects</title>
      <link>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415524#M1157028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I added in a distinct to the count for OR selection.&amp;nbsp; Take a look and see if it helps at all.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 21:24:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/And-Or-Subset-of-Objects/m-p/415524#M1157028</guid>
      <dc:creator />
      <dc:date>2013-02-08T21:24:59Z</dc:date>
    </item>
  </channel>
</rss>

