<?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 Set Analysis Query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Query/m-p/177913#M45312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;not quite clear to me, what your intention is and which is the relation to set-analysis.&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Sep 2009 03:21:47 GMT</pubDate>
    <dc:creator>prieper</dc:creator>
    <dc:date>2009-09-08T03:21:47Z</dc:date>
    <item>
      <title>Set Analysis Query</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Query/m-p/177912#M45311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;I'm wondering if anyone is able to assiste with the following query I need to run through set analysis&lt;/P&gt;&lt;P&gt;SELECT SUM(mems) FROM&lt;BR /&gt;(&lt;BR /&gt; ( SELECT count(*) AS mems&lt;BR /&gt; FROM table1&lt;BR /&gt; WHERE date_range BETWEEN min(report_date) and max(report_date)&lt;BR /&gt; AND status = 'C'&lt;BR /&gt; AND (channel &amp;lt;&amp;gt; old_channel&lt;BR /&gt; OR package &amp;lt;&amp;gt; old_package_id)&lt;BR /&gt; GROUP BY package, channel, pmi&lt;BR /&gt; HAVING package &amp;lt;&amp;gt; 14&lt;BR /&gt; )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kevin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 23:29:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Query/m-p/177912#M45311</guid>
      <dc:creator />
      <dc:date>2009-09-07T23:29:53Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Query</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Query/m-p/177913#M45312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;not quite clear to me, what your intention is and which is the relation to set-analysis.&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2009 03:21:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Query/m-p/177913#M45312</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2009-09-08T03:21:47Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Query</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Query/m-p/177914#M45313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Almost impossible for me to get this right on the first try without an example QVW to test it on and some more information, such as if old_channel and old_package_id are single values or a list of values, but something like this?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(aggr(count({&amp;lt;date_range={"&amp;gt;=$(=date(min(report_date))) &amp;lt;=$(=date(max(report_date)))"}&lt;BR /&gt; ,status={C}&lt;BR /&gt; ,package-={14}&lt;BR /&gt; &amp;gt;}&lt;BR /&gt; if(channel &amp;lt;&amp;gt; old_channel&lt;BR /&gt; or package &amp;lt;&amp;gt; old_package_id,1))&lt;BR /&gt; ,package,channel,pmi))&lt;/P&gt;&lt;P&gt;I implemented your OR without using set analysis. You CAN do a union of two sets, but I frankly expect that the performance would be worse than just doing the OR separately.&lt;/P&gt;&lt;P&gt;By the way, if I understand your SQL, the "having package &amp;lt;&amp;gt; 14" isn't any different than just putting that in as another condition in the select. I believe having is normally used when you need to check the RESULT of the SQL, such as if you wanted "having mems &amp;gt; 20".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 01:47:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Query/m-p/177914#M45313</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-09-09T01:47:50Z</dc:date>
    </item>
  </channel>
</rss>

