<?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: Exclusion does not work (set expressions) in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2425081#M96052</link>
    <description>&lt;P&gt;Let me explain to you:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ali_hijazi_0-1709193082915.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160925i25848307300C57B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ali_hijazi_0-1709193082915.png" alt="ali_hijazi_0-1709193082915.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tried to mimic your situation&lt;BR /&gt;in the first table I'm dispaying users where type = Y and profession ={IT,support}&lt;BR /&gt;in the second table I'm displaying users where type = N and profession {IT,support}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;now with your approach ali, and jean will appear&amp;nbsp;&lt;BR /&gt;so you want to exclude users who only have type = Y&lt;BR /&gt;so your expression would be :&lt;BR /&gt;aggr(Only{&amp;lt;user={"=type='Y'"}&amp;gt;}user),user)&lt;BR /&gt;&lt;BR /&gt;and this is what is displayed in the last table to the right&lt;BR /&gt;&lt;BR /&gt;the data that I used is as follows:&lt;BR /&gt;load * Inline [&lt;BR /&gt;user, type, profession&lt;BR /&gt;ali, Y, support&lt;BR /&gt;ali, N, IT&lt;BR /&gt;jean, Y, IT&lt;BR /&gt;maher, N, support&lt;BR /&gt;amir, Y, home&lt;BR /&gt;omar, N, IT&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;the expressions used in the tables are:&lt;BR /&gt;1.=aggr(only({&amp;lt;type={Y},profession={[support],[it]} &amp;gt;}user),user)&lt;BR /&gt;2.=aggr(only({&amp;lt;type={N},profession={[support],[it]} &amp;gt;}user),user)&lt;BR /&gt;3.=aggr(only({&lt;BR /&gt;&amp;lt;type={Y},profession={[support],[it]} &amp;gt;&lt;BR /&gt;-&lt;BR /&gt;&amp;lt;type={N},profession={[support],[it]} &amp;gt;&lt;BR /&gt;}user),user)&lt;BR /&gt;&lt;BR /&gt;4.&amp;nbsp;=aggr(only({&lt;BR /&gt;&amp;lt;user={"=type='Y'"},profession={[support],[it]} &amp;gt;&lt;BR /&gt;&lt;BR /&gt;}user),user)&lt;BR /&gt;&lt;BR /&gt;hope this helps&lt;/P&gt;</description>
    <pubDate>Thu, 29 Feb 2024 07:56:11 GMT</pubDate>
    <dc:creator>ali_hijazi</dc:creator>
    <dc:date>2024-02-29T07:56:11Z</dc:date>
    <item>
      <title>Exclusion does not work (set expressions)</title>
      <link>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2424950#M96040</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;We have two tables that have only one dimension (user_id) and nothing else:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;Table "&lt;EM&gt;&lt;STRONG&gt;S Users&lt;/STRONG&gt;&lt;/EM&gt;":&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RoyBatty_0-1709157812031.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160899iD015C23996C7EBA6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RoyBatty_0-1709157812031.png" alt="RoyBatty_0-1709157812031.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;Table "&lt;EM&gt;&lt;STRONG&gt;E Users&lt;/STRONG&gt;&lt;/EM&gt;":&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RoyBatty_1-1709157843442.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160900i8B9C8D2ACC4FABDF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RoyBatty_1-1709157843442.png" alt="RoyBatty_1-1709157843442.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For "&lt;EM&gt;&lt;STRONG&gt;S Users&lt;/STRONG&gt;&lt;/EM&gt;" we use the following set expression:&lt;/P&gt;
&lt;PRE&gt;=Aggr(&lt;BR /&gt;    Only({&amp;lt;[Standard Activity Period]={'N'}, [Activity]={'Payment', 'Support'}&amp;gt;} distinct [user_id]), &lt;BR /&gt;    [user_id]&lt;BR /&gt;)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;For "&lt;EM&gt;&lt;STRONG&gt;E Users&lt;/STRONG&gt;&lt;/EM&gt;" we use the following set expression (the only difference is 'Y' instead of 'N'):&lt;/P&gt;
&lt;PRE&gt;=Aggr(&lt;BR /&gt;    Only({&amp;lt;[Standard Activity Period]={'Y'}, [Activity]={'Payment', 'Support'}&amp;gt;} distinct [user_id]), &lt;BR /&gt;    [user_id]&lt;BR /&gt;)&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;We want to create a third table that will show only those "&lt;EM&gt;&lt;STRONG&gt;S Users&lt;/STRONG&gt;&lt;/EM&gt;" that are not in "&lt;EM&gt;&lt;STRONG&gt;E Users&lt;/STRONG&gt;&lt;/EM&gt;" (&lt;STRONG&gt;S - E&lt;/STRONG&gt;).&amp;nbsp;We tried the following with the &lt;EM&gt;Exclusion&lt;/EM&gt; (-) operator:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;=Aggr(&lt;BR /&gt;    Only(&lt;BR /&gt;        {&lt;BR /&gt;           $&amp;lt;[Standard Activity Period]={'N'}, [Activity]={'Payment', 'Support'}&amp;gt;&lt;BR /&gt;           -&lt;BR /&gt;           $&amp;lt;[Standard Activity Period]={'Y'}, [Activity]={'Payment', 'Support'}&amp;gt;&lt;BR /&gt;        } &lt;BR /&gt;        distinct [user_id]&lt;BR /&gt;    ), &lt;BR /&gt;    [user_id]&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;but it doesn't work, it gives a wrong result (please see the third table in the image below):&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RoyBatty_2-1709158767760.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160901iBF37CC0CC8549199/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RoyBatty_2-1709158767760.png" alt="RoyBatty_2-1709158767760.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;The expression is probably written incorrectly (there is no error but it does not give the correct result), but we cannot find out what the problem is and how we can solve this. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Do you have any ideas or suggestions as to what that expression should look like? Thanks in advance!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 22:25:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2424950#M96040</guid>
      <dc:creator>RoyBatty</dc:creator>
      <dc:date>2024-02-28T22:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusion does not work (set expressions)</title>
      <link>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2424961#M96041</link>
      <description>&lt;P&gt;I'm not really sure why you did those expression, let me know if i'm missing something, but this is what I would do:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If your table has the, User ID, Standard Activity Period and the Activity fields, you could do:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;aggr(
    		 Only(
  				  {&amp;lt;ActivityPeriod={'Y'}
				
				  &amp;gt;}
      user_id) , user_id)&lt;/LI-CODE&gt;
&lt;P&gt;Basically, you are getting only the fields that contains the "Y" on the Standard Activity Period Field, then I use Aggr by user_id, and return only the field that I want:&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Zapparoli_0-1709164800463.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160903i536A446905CF797F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Zapparoli_0-1709164800463.png" alt="Zapparoli_0-1709164800463.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps you.&lt;/P&gt;
&lt;P&gt;-Zapparoli&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Feb 2024 23:59:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2424961#M96041</guid>
      <dc:creator>Zapparoli</dc:creator>
      <dc:date>2024-02-28T23:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusion does not work (set expressions)</title>
      <link>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2425073#M96049</link>
      <description>&lt;P&gt;sometimes we use this approach when there is no expression to be computed&lt;BR /&gt;so as he's saying above, we wants to list the dimension values satisfying some conditions&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 07:48:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2425073#M96049</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2024-02-29T07:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusion does not work (set expressions)</title>
      <link>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2425081#M96052</link>
      <description>&lt;P&gt;Let me explain to you:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ali_hijazi_0-1709193082915.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160925i25848307300C57B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ali_hijazi_0-1709193082915.png" alt="ali_hijazi_0-1709193082915.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tried to mimic your situation&lt;BR /&gt;in the first table I'm dispaying users where type = Y and profession ={IT,support}&lt;BR /&gt;in the second table I'm displaying users where type = N and profession {IT,support}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;now with your approach ali, and jean will appear&amp;nbsp;&lt;BR /&gt;so you want to exclude users who only have type = Y&lt;BR /&gt;so your expression would be :&lt;BR /&gt;aggr(Only{&amp;lt;user={"=type='Y'"}&amp;gt;}user),user)&lt;BR /&gt;&lt;BR /&gt;and this is what is displayed in the last table to the right&lt;BR /&gt;&lt;BR /&gt;the data that I used is as follows:&lt;BR /&gt;load * Inline [&lt;BR /&gt;user, type, profession&lt;BR /&gt;ali, Y, support&lt;BR /&gt;ali, N, IT&lt;BR /&gt;jean, Y, IT&lt;BR /&gt;maher, N, support&lt;BR /&gt;amir, Y, home&lt;BR /&gt;omar, N, IT&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;the expressions used in the tables are:&lt;BR /&gt;1.=aggr(only({&amp;lt;type={Y},profession={[support],[it]} &amp;gt;}user),user)&lt;BR /&gt;2.=aggr(only({&amp;lt;type={N},profession={[support],[it]} &amp;gt;}user),user)&lt;BR /&gt;3.=aggr(only({&lt;BR /&gt;&amp;lt;type={Y},profession={[support],[it]} &amp;gt;&lt;BR /&gt;-&lt;BR /&gt;&amp;lt;type={N},profession={[support],[it]} &amp;gt;&lt;BR /&gt;}user),user)&lt;BR /&gt;&lt;BR /&gt;4.&amp;nbsp;=aggr(only({&lt;BR /&gt;&amp;lt;user={"=type='Y'"},profession={[support],[it]} &amp;gt;&lt;BR /&gt;&lt;BR /&gt;}user),user)&lt;BR /&gt;&lt;BR /&gt;hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 07:56:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2425081#M96052</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2024-02-29T07:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusion does not work (set expressions)</title>
      <link>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2425355#M96093</link>
      <description>&lt;P&gt;&lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Thank you so much!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 14:25:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Exclusion-does-not-work-set-expressions/m-p/2425355#M96093</guid>
      <dc:creator>RoyBatty</dc:creator>
      <dc:date>2024-02-29T14:25:10Z</dc:date>
    </item>
  </channel>
</rss>

