<?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 Expression that compares difference of two sets based on filtering with aggregation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522205#M106643</link>
    <description>&lt;P&gt;I am using the following expression to filter for count of a dimension based on filtering with aggregation with an alternate state filter:&lt;/P&gt;
&lt;P&gt;{[Group 1]} COUNT( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((AGGR(SUM([Sales), [Product]) &amp;gt;= 50)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AND (AGGR(SUM({&amp;lt;Category={'E'}&amp;gt;}[Sales]), [Product]) &amp;gt;= 20), [Product])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;My goal is to use an alternate state to create an identical expression with another alternate state like below:&lt;/P&gt;
&lt;P&gt;{[Group 2]} COUNT( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((AGGR(SUM([Sales), [Product]) &amp;gt;= 50)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AND (AGGR(SUM({&amp;lt;Category={'E'}&amp;gt;}[Sales]), [Product]) &amp;gt;= 20), [Product])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;Then I want to compare the dimension values in each set to determine which values exist in Group 1 that do not exist in Group 2. The alternate state filters will be just a simple dimension = value (i.e. Year = 2025, Year = 2024)&lt;/P&gt;
&lt;P&gt;The result of the expression will be the count of unique values only in Group 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried below but had no success.&lt;/P&gt;
&lt;P&gt;{&amp;lt;&lt;/P&gt;
&lt;P&gt;{[Group 1]} COUNT( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((AGGR(SUM([Sales), [Product]) &amp;gt;= 50)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AND (AGGR(SUM({&amp;lt;Category={'E'}&amp;gt;}[Sales]), [Product]) &amp;gt;= 20), [Product])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;)&amp;gt;&lt;BR /&gt;-&lt;BR /&gt;&amp;lt;&lt;/P&gt;
&lt;P&gt;{[Group 2]} COUNT( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((AGGR(SUM([Sales), [Product]) &amp;gt;= 50)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AND (AGGR(SUM({&amp;lt;Category={'E'}&amp;gt;}[Sales]), [Product]) &amp;gt;= 20), [Product])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;)&amp;gt;}&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;Any suggestions appreciated!&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 24 Jun 2025 20:29:43 GMT</pubDate>
    <dc:creator>NattiNatey</dc:creator>
    <dc:date>2025-06-24T20:29:43Z</dc:date>
    <item>
      <title>Expression that compares difference of two sets based on filtering with aggregation</title>
      <link>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522205#M106643</link>
      <description>&lt;P&gt;I am using the following expression to filter for count of a dimension based on filtering with aggregation with an alternate state filter:&lt;/P&gt;
&lt;P&gt;{[Group 1]} COUNT( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((AGGR(SUM([Sales), [Product]) &amp;gt;= 50)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AND (AGGR(SUM({&amp;lt;Category={'E'}&amp;gt;}[Sales]), [Product]) &amp;gt;= 20), [Product])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;My goal is to use an alternate state to create an identical expression with another alternate state like below:&lt;/P&gt;
&lt;P&gt;{[Group 2]} COUNT( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((AGGR(SUM([Sales), [Product]) &amp;gt;= 50)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AND (AGGR(SUM({&amp;lt;Category={'E'}&amp;gt;}[Sales]), [Product]) &amp;gt;= 20), [Product])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;Then I want to compare the dimension values in each set to determine which values exist in Group 1 that do not exist in Group 2. The alternate state filters will be just a simple dimension = value (i.e. Year = 2025, Year = 2024)&lt;/P&gt;
&lt;P&gt;The result of the expression will be the count of unique values only in Group 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried below but had no success.&lt;/P&gt;
&lt;P&gt;{&amp;lt;&lt;/P&gt;
&lt;P&gt;{[Group 1]} COUNT( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((AGGR(SUM([Sales), [Product]) &amp;gt;= 50)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AND (AGGR(SUM({&amp;lt;Category={'E'}&amp;gt;}[Sales]), [Product]) &amp;gt;= 20), [Product])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;)&amp;gt;&lt;BR /&gt;-&lt;BR /&gt;&amp;lt;&lt;/P&gt;
&lt;P&gt;{[Group 2]} COUNT( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((AGGR(SUM([Sales), [Product]) &amp;gt;= 50)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AND (AGGR(SUM({&amp;lt;Category={'E'}&amp;gt;}[Sales]), [Product]) &amp;gt;= 20), [Product])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;)&amp;gt;}&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;Any suggestions appreciated!&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Jun 2025 20:29:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522205#M106643</guid>
      <dc:creator>NattiNatey</dc:creator>
      <dc:date>2025-06-24T20:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Expression that compares difference of two sets based on filtering with aggregation</title>
      <link>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522209#M106644</link>
      <description>&lt;P&gt;Your first expression should be:&lt;/P&gt;
&lt;P&gt;{Group 1}Count({&amp;lt;Product={"=Sum(Sales)&amp;gt;50"}&amp;gt;*&amp;lt;Category={E}&amp;gt;}Product)&lt;/P&gt;
&lt;P&gt;and the second should be:&lt;/P&gt;
&lt;P&gt;{Group 2}Count({&amp;lt;Product={"=Sum(Sales)&amp;gt;50"}&amp;gt;*&amp;lt;Category={E}&amp;gt;}Product)&lt;/P&gt;
&lt;P&gt;so next would be ..&lt;/P&gt;
&lt;P&gt;{Group 1}Count({&amp;lt;Product={"=Sum(Sales)&amp;gt;50"}&amp;gt;*&amp;lt;Category={E}&amp;gt;}Product)&lt;/P&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;P&gt;{Group 2}Count({&amp;lt;Product={"=Sum(Sales)&amp;gt;50"}&amp;gt;*&amp;lt;Category={E}&amp;gt;}Product)&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 00:24:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522209#M106644</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2025-06-25T00:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Expression that compares difference of two sets based on filtering with aggregation</title>
      <link>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522361#M106655</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/5905"&gt;@Lisa_P&lt;/a&gt;&amp;nbsp;, thanks so much for your response! I was unaware of this syntax where you can use the intersection of two filtered sets of data. I think there is one difference in your solution than in my question.&lt;/P&gt;
&lt;P&gt;Your solution filters SUM(Sales) by Product &amp;gt; 50 in the first set and then Category = {'E'} in the second set. My question filters SUM(Sales) by Product &amp;gt; 50 (same as yours) in the first set and Category = {'E'} AND&amp;nbsp;SUM(Sales) by Product &amp;gt; 20 in the second.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know if it is possible to add this second filter condition to the second set?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 21:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522361#M106655</guid>
      <dc:creator>NattiNatey</dc:creator>
      <dc:date>2025-06-25T21:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Expression that compares difference of two sets based on filtering with aggregation</title>
      <link>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522383#M106656</link>
      <description>&lt;P&gt;Sorry, I must have copied and forgot to change, yes please change the second one.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 04:55:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522383#M106656</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2025-06-26T04:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Expression that compares difference of two sets based on filtering with aggregation</title>
      <link>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522736#M106701</link>
      <description>&lt;P&gt;I added the second filter and this worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;{Group 1}Count({&amp;lt;Product={"=Sum(Sales)&amp;gt;50"}&amp;gt;*&amp;lt;Product ={"={&amp;lt;Category={E}&amp;gt;}Sum(Sales)&amp;gt;20"}&amp;gt;}Product)&lt;/P&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;P&gt;{Group 2}Count({&amp;lt;Product={"=Sum(Sales)&amp;gt;50"}&amp;gt;*&amp;lt;Product ={"={&amp;lt;Category={E}&amp;gt;}Sum(Sales)&amp;gt;20"}&amp;gt;}Product)&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2025 21:12:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Expression-that-compares-difference-of-two-sets-based-on/m-p/2522736#M106701</guid>
      <dc:creator>NattiNatey</dc:creator>
      <dc:date>2025-06-30T21:12:11Z</dc:date>
    </item>
  </channel>
</rss>

