<?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: Set analysis filter in AGGR function not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168204#M909277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just want to mention this here, even though it is not needed in your case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using -=, this will ignore the NULLs also. If you have more than one Dim in the Set Analysis, it will throw a wrong result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a multi Dim Set Analysis E() can be used instead.&lt;/P&gt;&lt;P&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;=SUM(Aggr(SUM({$&amp;lt;[SalesAmt]=&lt;STRONG&gt;E&lt;/STRONG&gt;({&amp;lt;[Sales Rep ID] ={'0'}&amp;gt;})&amp;gt;} DISTINCT [SalesAmt]),Day, [Sales Rep Type], [Sales Rep ID], [Cust Acct Num]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more details see&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4424"&gt;Excluding values in Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jun 2016 01:03:45 GMT</pubDate>
    <dc:creator>Saravanan_Desingh</dc:creator>
    <dc:date>2016-06-23T01:03:45Z</dc:date>
    <item>
      <title>Set analysis filter in AGGR function not working</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168200#M909273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings, Qlikview gurus!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to Qlikview and having a hard time figuring out something that is maddeningly easy in SQL Server syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set where I am calculating sales totals.This expression gives me the exact grand totals I expect - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM(Aggr(SUM(DISTINCT [Sales Amt]),Day, [Sales Rep Type], [Sales Rep ID], [Cust Acct Num]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far, so good.&amp;nbsp; Incidentally, I have to use the DISTINCT clause there to compress duplicate records out of the data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I need the report to actually show totals excluding "house accounts" (ie, sales rep ID &amp;gt; "0").&amp;nbsp; I've tried various methods of set analysis to get there and none of them have worked.&amp;nbsp; My totals keep coming back as 0.&amp;nbsp; Here's an example of one way that I laid out the syntax - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM(Aggr(SUM({$&amp;lt;[Sales Rep ID]={"&amp;gt;0"}&amp;gt;} DISTINCT [SalesAmt]),Day, [Sales Rep Type], [Sales Rep ID], [Cust Acct Num]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's just one example.&amp;nbsp; I've tried the set analysis snippet just about everywhere possible in the expression, always getting zeros back. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, the sales rep ID field is text, not a number.&amp;nbsp; And yes, I'm sure that other reps besides the "house account" had sales.&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&amp;nbsp; Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168200#M909273</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter in AGGR function not working</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168201#M909274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this:&lt;/P&gt;&lt;P&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;STRONG&gt;=Sum(Aggr(Sum({$&amp;lt;[Sales Rep ID]={"=Num#([Sales Rep ID]) &amp;gt; 0"}&amp;gt;} DISTINCT [SalesAmt]),Day, [Sales Rep Type], [Sales Rep ID], [Cust Acct Num]))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&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;STRONG&gt;=Sum(Aggr(Sum({$&amp;lt;[Sales Rep ID]={'&amp;lt;&amp;gt;0'}&amp;gt;} DISTINCT [SalesAmt]),Day, [Sales Rep Type], [Sales Rep ID], [Cust Acct Num]))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 22:02:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168201#M909274</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-21T22:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter in AGGR function not working</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168202#M909275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some samples of field values you want to exclude and include might help to understand better what you may need&amp;nbsp; here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess your issue is indeed that you are coping with text values and thus a numeric search won't work well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to exclude the text value '0' and keep all other values, maybe something like&lt;/P&gt;&lt;P&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;=SUM(Aggr(SUM({$&amp;lt;[Sales Rep ID] -={'0'}&amp;gt;} DISTINCT [SalesAmt]),Day, [Sales Rep Type], [Sales Rep ID], [Cust Acct Num]))&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;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;or &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;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=SUM(Aggr(SUM({$&amp;lt;[Sales Rep ID]={"*"} - {'0'}&amp;gt;} DISTINCT [SalesAmt]),Day, [Sales Rep Type], [Sales Rep ID], [Cust Acct Num]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;might work. See also&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4424"&gt;Excluding values in Set Analysis&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 22:20:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168202#M909275</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-21T22:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter in AGGR function not working</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168203#M909276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for the help, swuehl!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got the correct result using the "minus-equals" (-=) syntax you recommended.&amp;nbsp; I did use double-quotes around the zero instead of single-quotes, but it was really the minus-equals that solved the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, quick note for anyone reading this thread - I had to keep a space after the word "DISTINCT" for the expression to work properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again, swuehl!&amp;nbsp; You saved what little sanity I have left!&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 01:49:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168203#M909276</guid>
      <dc:creator />
      <dc:date>2016-06-22T01:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis filter in AGGR function not working</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168204#M909277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just want to mention this here, even though it is not needed in your case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using -=, this will ignore the NULLs also. If you have more than one Dim in the Set Analysis, it will throw a wrong result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a multi Dim Set Analysis E() can be used instead.&lt;/P&gt;&lt;P&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;=SUM(Aggr(SUM({$&amp;lt;[SalesAmt]=&lt;STRONG&gt;E&lt;/STRONG&gt;({&amp;lt;[Sales Rep ID] ={'0'}&amp;gt;})&amp;gt;} DISTINCT [SalesAmt]),Day, [Sales Rep Type], [Sales Rep ID], [Cust Acct Num]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more details see&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4424"&gt;Excluding values in Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 01:03:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-filter-in-AGGR-function-not-working/m-p/1168204#M909277</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2016-06-23T01:03:45Z</dc:date>
    </item>
  </channel>
</rss>

