<?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 Multiple selection criteria in a set analysis? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319626#M495374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;AdmitMethod-={'81'},d01={'I21*','I22*','R07*'},d02={'121*','122*'}&amp;gt;} AdmCounter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jan 2012 09:13:14 GMT</pubDate>
    <dc:creator>CELAMBARASAN</dc:creator>
    <dc:date>2012-01-31T09:13:14Z</dc:date>
    <item>
      <title>Multiple selection criteria in a set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319624#M495372</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;I have an expression that covers some multiple selection criteria / options between the inter-related values of two fields, d01 and d02. As an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;P&gt;if(AdmitMethod&amp;lt;&amp;gt;'81' &lt;/P&gt;&lt;P&gt;and ((d01 like 'I21*') or (d01 like 'I22*') or ((d01 like 'R07*') and ((d02 like 'I21*') or (d02 like 'I22*'))))&lt;/P&gt;&lt;P&gt;,AdmCounter))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, this works of course, but it's a little wieldly and will only get worse the more combinations of d01 and d02 I have to cover.&lt;/P&gt;&lt;P&gt;Using a set analysis approach, so far I've arrived at:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;~AdmitMethod={'81'},d01Ch={'I21','I22','R07'}&amp;gt;}AdmCounter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where d01Ch is, usefully in this case, the 3 character version of d01 (which can be 4-6 characters long, the first 3 providing the grouping).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see the two expressions are different. I'm wondering if there's a neat and tidy way to incorporate the d01/d02 relationship for ... OR (d01 = R07 AND (d02=I21 OR d02=I22)) into the set analysis, whilst maintaining the 'd01Ch can equal I21 or I22' part. &lt;/P&gt;&lt;P&gt;Can anyone suggest a way to achieve this please?&lt;/P&gt;&lt;P&gt;All help and advice most welcome.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 08:46:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319624#M495372</guid>
      <dc:creator>graham-crooks</dc:creator>
      <dc:date>2012-01-31T08:46:01Z</dc:date>
    </item>
    <item>
      <title>Multiple selection criteria in a set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319625#M495373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try this below expression &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;AdmitMethod-={'81'},d01= {'121*','122*','R07*'},d02= {'122*'}&amp;gt;}AdmCounter)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards ,&lt;/P&gt;&lt;P&gt;Perumal A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 08:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319625#M495373</guid>
      <dc:creator>perumal_41</dc:creator>
      <dc:date>2012-01-31T08:57:29Z</dc:date>
    </item>
    <item>
      <title>Multiple selection criteria in a set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319626#M495374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;AdmitMethod-={'81'},d01={'I21*','I22*','R07*'},d02={'121*','122*'}&amp;gt;} AdmCounter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 09:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319626#M495374</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-01-31T09:13:14Z</dc:date>
    </item>
    <item>
      <title>Multiple selection criteria in a set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319627#M495375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Perumal &amp;amp; Celambarasan - Thank you for your suggestions.&lt;/P&gt;&lt;P&gt;As the various elements within the set analysis effectively form an AND statement, sadly this doesn't work; the determination effectively becomes 'if d01 = any of... AND if d02 = any of...'. The problem I have here is that if d01 &lt;EM&gt;is&lt;/EM&gt; I21* or I22* then d02 certainly will &lt;EM&gt;not&lt;/EM&gt; be; if d01 is R07, then d02 &lt;EM&gt;might&lt;/EM&gt; be I21* or I22*. But being willing to try anything once, I've tried the suggestion. The data simply disappears as there is now no match. Any other suggestions would, however, be most welcome.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 22:45:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319627#M495375</guid>
      <dc:creator>graham-crooks</dc:creator>
      <dc:date>2012-01-31T22:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple selection criteria in a set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319628#M495376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Graham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about using two (or more) set modifiers instead of just one?&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;Sum({&amp;lt; AdmitMethod -= {'81'}, d01 = {"121*", "122*", "R07*"} &amp;gt; + &amp;lt; AdmitMethod -= {'81'},&amp;nbsp; d02 = {"122*"} &amp;gt;} AdmCounter)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That "+" sign means that the values of AdmCounter will be summed up when values correspond to either the first or the second modifier (things between &amp;lt;&amp;gt;). The above should return the same as&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;&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; white-space: pre; background-color: #ffffff;"&gt;Sum({&amp;lt; AdmitMethod -= {'81'} &amp;gt; * (&amp;lt; d01 = {"121*", "122*", "R07*"} &amp;gt; + &amp;lt; d02 = {"122*"} &amp;gt;)} AdmCounter)&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That can be read as "return the sum of values in AdmCounter for the data set where AdmitMethod is not 81 and ("*") either d01 or d02 (or both) ("+") have the values specified".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps and makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 23:38:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319628#M495376</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-01-31T23:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple selection criteria in a set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319629#M495377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel&lt;/P&gt;&lt;P&gt;Thank you for this inspiration - I knew there must be a way! Using your thinking I arrived at:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;AdmitMethod-={'81'}&amp;gt;*(&amp;lt;d01={'I21*','I22*'}&amp;gt; + &amp;lt;d01={'R07'},d02={'I21*','I22*'}&amp;gt;)}AdmCounter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which now matches the logic of my original if statement and the two charts provide the same answers. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;I hadn't appreciated that I could use more than one set modifier grouping. &lt;/P&gt;&lt;P&gt;This is really helpful. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 00:34:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiple-selection-criteria-in-a-set-analysis/m-p/319629#M495377</guid>
      <dc:creator>graham-crooks</dc:creator>
      <dc:date>2012-02-01T00:34:24Z</dc:date>
    </item>
  </channel>
</rss>

