<?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: How to exclude one data set from another in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496075#M102631</link>
    <description>&lt;P&gt;I'd like to point you to an alternate solution that I think will work better in the long run. In the Set Analysis help page there is some mention of set modifiers with set operators&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalysis/set-modifiers-set-operators.htm" target="_blank" rel="noopener"&gt;set modifiers set operators&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//Expressions using set analysis
/*In Period1*/
=Count({&amp;lt;Item = {"=Sum(Period1)&amp;gt;0"}&amp;gt;}Item)

/*In Period2*/
=Count({&amp;lt;Item = {"=Sum(Period2)&amp;gt;0"}&amp;gt;}Item)

/*In Period1 but not Period2*/
=Count({&amp;lt;Item = {"=Sum(Period1)&amp;gt;0"}&amp;gt;-&amp;lt;Item = {"=Sum(Period2)&amp;gt;0"}&amp;gt;}Item)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2024 20:27:12 GMT</pubDate>
    <dc:creator>chriscammers</dc:creator>
    <dc:date>2024-12-04T20:27:12Z</dc:date>
    <item>
      <title>How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496060#M102627</link>
      <description>&lt;P&gt;Hi All. &lt;BR /&gt;Could you please give me a hint how to calculate how may Items from period 1 don't have values in period 2?&lt;BR /&gt;&lt;BR /&gt;This should be 3 as an count result (Item2, Item3, Item6). But is there any option to calculate this not using If statement I use currently Sum(If( Len(Period1)&amp;gt;0 and Len(Period2)&amp;lt;1,1). &lt;BR /&gt;&lt;BR /&gt;Maybe exist something like&amp;nbsp;Count({&amp;lt;Period1-=Period2&amp;gt;}Item)? Or something other solution that allows to take one data set and exclude from it all items that exists in other data set?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Peony_2-1733339091383.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/175205i8EFD2F81EAD2CF0B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Peony_2-1733339091383.png" alt="Peony_2-1733339091383.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Peony_0-1733338354615.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/175203iBC1ECE3630F013AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Peony_0-1733338354615.png" alt="Peony_0-1733338354615.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 19:09:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496060#M102627</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2024-12-04T19:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496069#M102629</link>
      <description>&lt;P&gt;Solution could looks like this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;=Count({&amp;lt;[Period1]-={"","NULL"},[Period2]={"","NULL"}&amp;gt;}Item)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 19:54:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496069#M102629</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2024-12-04T19:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496074#M102630</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/7275"&gt;@Peony&lt;/a&gt;&amp;nbsp;, check this another option, with this script, that can make the difference between Null y BLANK, in this example, with the INLINE, the empty field is recognized as BLANK = ''&lt;/P&gt;
&lt;P&gt;Test_Set:&lt;BR /&gt;Load * INLINE [&lt;BR /&gt;Item, Period1&lt;BR /&gt;Item1, 1&lt;BR /&gt;Item2, 2&lt;BR /&gt;Item3, 2 &lt;BR /&gt;Item4, &lt;BR /&gt;Item5, 5&lt;BR /&gt;Item6, 2 &lt;BR /&gt;Item7, &lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;Test_Set_2:&lt;BR /&gt;Load * INLINE [&lt;BR /&gt;Item, Period2&lt;BR /&gt;Item1, 3&lt;BR /&gt;Item2,&lt;BR /&gt;Item3,&lt;BR /&gt;Item4, 4&lt;BR /&gt;Item5, 6&lt;BR /&gt;Item6,&lt;BR /&gt;Item7, 9&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;exit script;&lt;/P&gt;
&lt;P&gt;and the chart expression formula :&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;count(if( Period2 = '', Item))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QFabian_0-1733343841566.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/175211i891882B997167EB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="QFabian_0-1733343841566.png" alt="QFabian_0-1733343841566.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 20:25:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496074#M102630</guid>
      <dc:creator>QFabian</dc:creator>
      <dc:date>2024-12-04T20:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496075#M102631</link>
      <description>&lt;P&gt;I'd like to point you to an alternate solution that I think will work better in the long run. In the Set Analysis help page there is some mention of set modifiers with set operators&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalysis/set-modifiers-set-operators.htm" target="_blank" rel="noopener"&gt;set modifiers set operators&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//Expressions using set analysis
/*In Period1*/
=Count({&amp;lt;Item = {"=Sum(Period1)&amp;gt;0"}&amp;gt;}Item)

/*In Period2*/
=Count({&amp;lt;Item = {"=Sum(Period2)&amp;gt;0"}&amp;gt;}Item)

/*In Period1 but not Period2*/
=Count({&amp;lt;Item = {"=Sum(Period1)&amp;gt;0"}&amp;gt;-&amp;lt;Item = {"=Sum(Period2)&amp;gt;0"}&amp;gt;}Item)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 20:27:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496075#M102631</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2024-12-04T20:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496077#M102632</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/121051"&gt;@QFabian&lt;/a&gt;&amp;nbsp;Thank you for your idea! It is so elegant!&lt;span class="lia-unicode-emoji" title=":smiling_face_with_heart_eyes:"&gt;😍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 20:39:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496077#M102632</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2024-12-04T20:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496078#M102633</link>
      <description>&lt;P&gt;glad to help!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 20:40:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496078#M102633</guid>
      <dc:creator>QFabian</dc:creator>
      <dc:date>2024-12-04T20:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496082#M102634</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14016"&gt;@chriscammers&lt;/a&gt;&amp;nbsp;Your idea is definitely what I need in a perfect run! But I'm a bit confused how I can apply your example to my actual data. If you would not mind, could&amp;nbsp; you please help to rewrite final expression? Because I'm lost with syntaxis. Just for Period1, how does formula will looks like?&amp;nbsp;&lt;BR /&gt;Period1 is some date set that could be changed in dashboard's calendar. It has dome start_date and end_date.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;=Count({&amp;lt;Item = {"=Sum(Date={"&amp;gt;$(=$(vDateStart))&amp;lt;=$(=$(vDateEnd))"})&amp;gt;0"}&amp;gt;}Item)&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will such syntaxis be correct? I'm confused a bit in using Sum inside set expression especially in combination with dates&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 21:06:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496082#M102634</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2024-12-04T21:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496261#M102650</link>
      <description>&lt;P&gt;Oh, let's be clear you are trying to show the items that sold in a particular time period but not in a second time period, for example Items that have not sold this year?&lt;/P&gt;
&lt;P&gt;So you need to establish your sets using the P and E functions returns items based on the set analysis used in the function P is the "possible" values and E is the "Excluded" values&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Items from last year &amp;lt;Item = P({&amp;lt;YearField = {'$(=Max(YearField) - 1)'}&amp;gt;})&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Items that did not sell This year &amp;lt;Item = E({&amp;lt;YearField = {'$(=Max(YearField))'}&amp;gt;})&amp;gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Now combine the two using set operators in your count function&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;Item = P({&amp;lt;YearField = {'$(=Max(YearField) - 1)'}&amp;gt;})&amp;gt; - &amp;lt;Item = E({&amp;lt;YearField = {'$(=Max(YearField))'}&amp;gt;})&amp;gt;}Item)&lt;/P&gt;
&lt;P&gt;I will admit this is an area Qlik should expand on it's documentation but this page&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalysis/set-modifiers-set-operators.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalysis/set-modifiers-set-operators.htm&lt;/A&gt;&amp;nbsp;provides the starting blocks you will need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for doing the selection based on a range of dates the syntax without calculating it is something like this&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;DateField = {"&amp;gt;=1/1/2023&amp;lt;=12/31/2023"}&amp;gt;} Item)&lt;/P&gt;
&lt;P&gt;If you want to dynamically calculate the range of dates then you have to use dollar sign expansion in place of the search string between the double quotes $(='&amp;gt;=' &amp;amp; YearStart(Max(DateField),-1)) &amp;amp; '&amp;lt;=' &amp;amp;&amp;nbsp;YearEnd(Max(DateField),-1)))&lt;/P&gt;
&lt;P&gt;I suggest you start off with small chunks of this, hard code it first and then replace the hard coded parts with dynamic formulas. That way you'll know what the various expressions need to return when things get complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good Luck&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 14:13:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496261#M102650</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2024-12-05T14:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude one data set from another</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496660#M102684</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14016"&gt;@chriscammers&lt;/a&gt;&amp;nbsp;Thank you much for you time and detailed explanation.&lt;span class="lia-unicode-emoji" title=":handshake:"&gt;🤝&lt;/span&gt; It is really makes my set analysis understanding better and I my deal with more complicated solutions.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 10:51:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-exclude-one-data-set-from-another/m-p/2496660#M102684</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2024-12-07T10:51:25Z</dc:date>
    </item>
  </channel>
</rss>

