<?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 Operators not calculating result correctly in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863484#M71260</link>
    <description>&lt;P&gt;I'm not sure what's going on behind the scenes with the Qlik engine, but I did notice that I get the incorrect values like you did using your formula, but if I replace EmployeeID with EmployeeName, I get the correct result. Perhaps there's an issue here related to aggregating a key field when applying set operators across multiple tables - I was able to generate similar problems using even the most basic set operators, for example the set here should return a list of all employee IDs but it only returns 1 through 9.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1637834686372.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67418i3E8413A92C48274B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1637834686372.png" alt="Or_0-1637834686372.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Presumably not coincidentally, these are all of the employees which have sales, so my guess is that the engine is counting out the EmployeeID from the OrderHeader or Territories table rather than the one in the Employees table. Perhaps an odd aspect of a multi-table key field with set operators (though this doesn't seem like it should be anything intentional to me)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Nov 2021 10:11:59 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2021-11-25T10:11:59Z</dc:date>
    <item>
      <title>Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863422#M71245</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would like to understand why the operators in the following KPI objects in Qlik Sense is not calculating the results correctly.&amp;nbsp; See image below.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the left you will find the data set and on the right you will find three KPI objects.&amp;nbsp; I have added the expression of each one of the KPI objects as a foot note and have also added the correct answer that I am expecting as a heading at the top of each KPI object.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannEls_0-1637834100277.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67415iE53AAB4A2B8DE47C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannEls_0-1637834100277.png" alt="JohannEls_0-1637834100277.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running it on Qlik Sense Desktop November 2021 (14.44.5)&lt;/P&gt;
&lt;P&gt;I am out of ideas - some of my students could get the correct results on older versions of Qlik Sense.&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be welcome!&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 16:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863422#M71245</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-30T16:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863426#M71246</link>
      <description>&lt;P&gt;Could you share your qvf?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 08:47:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863426#M71246</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-11-25T08:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863431#M71247</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;No problem - please find app attached below.&lt;/P&gt;
&lt;P&gt;Incorrect App has been deleted - find correct App download in later chat below.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:42:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863431#M71247</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T09:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863441#M71249</link>
      <description>&lt;P&gt;I see in my desktop (Nov 2020) as:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tresesco_0-1637831581043.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67410i1EA125C8F9911471/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tresesco_0-1637831581043.png" alt="tresesco_0-1637831581043.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:13:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863441#M71249</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-11-25T09:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863446#M71250</link>
      <description>&lt;P&gt;I see that your fourth KPI from the top is also still calculating it incorrectly.&amp;nbsp; Is there perhaps a setting on Qlik Sense desktop that you might think that could cause this?&lt;BR /&gt;In my class on Set Analysis - some students get the same incorrect results as I do and some get the correct results and some partially correct results.&lt;BR /&gt;Here is the screen pic on my side again:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannEls_0-1637832064655.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67411i5033C24B33433120/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannEls_0-1637832064655.png" alt="JohannEls_0-1637832064655.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:25:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863446#M71250</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T09:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863449#M71251</link>
      <description>&lt;P&gt;Your third KPI expression is wrong; it is not the same as being shown on the footer.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:26:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863449#M71251</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-11-25T09:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863452#M71252</link>
      <description>&lt;P&gt;Sorry - saw that just now - still one of the tests that I have done - just change the last KPI's Expression to what is in the footer.&amp;nbsp; I will do the same on my side and share the screen pic.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:30:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863452#M71252</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T09:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863457#M71253</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannEls_0-1637832680936.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67412iBE3C8A7AF54B397F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannEls_0-1637832680936.png" alt="JohannEls_0-1637832680936.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="JohannEls_1-1637832744730.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67413i853AD93F4B5B2C26/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannEls_1-1637832744730.png" alt="JohannEls_1-1637832744730.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:32:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863457#M71253</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T09:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863459#M71254</link>
      <description>&lt;P&gt;Here is the app again with the correction done on the bottom KPI.&amp;nbsp; But it is still giving me the same incorrect results.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:37:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863459#M71254</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T09:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863462#M71255</link>
      <description>&lt;P&gt;I can't test on Nov 2021 version now. What about the versions and results your class mates are using?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:39:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863462#M71255</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-11-25T09:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863464#M71256</link>
      <description>&lt;P&gt;Unfortunately I do not have any connection to the students anymore.&amp;nbsp; The class was held yesterday.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:44:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863464#M71256</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T09:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863470#M71259</link>
      <description>&lt;P&gt;I have also experienced this with a prior version earlier this year during the same course that I gave.&lt;BR /&gt;I have absolutely no idea what causes this inconsistency with Set Analysis in Qlik Sense.&lt;BR /&gt;Perhaps Qlik could shine some light on this issue...&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:51:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863470#M71259</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T09:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863484#M71260</link>
      <description>&lt;P&gt;I'm not sure what's going on behind the scenes with the Qlik engine, but I did notice that I get the incorrect values like you did using your formula, but if I replace EmployeeID with EmployeeName, I get the correct result. Perhaps there's an issue here related to aggregating a key field when applying set operators across multiple tables - I was able to generate similar problems using even the most basic set operators, for example the set here should return a list of all employee IDs but it only returns 1 through 9.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1637834686372.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67418i3E8413A92C48274B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1637834686372.png" alt="Or_0-1637834686372.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Presumably not coincidentally, these are all of the employees which have sales, so my guess is that the engine is counting out the EmployeeID from the OrderHeader or Territories table rather than the one in the Employees table. Perhaps an odd aspect of a multi-table key field with set operators (though this doesn't seem like it should be anything intentional to me)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 10:11:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863484#M71260</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-25T10:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863502#M71262</link>
      <description>&lt;P&gt;I have now changed the count to rather count the EmployeeName as mentioned by "Or" and it calculated it perfectly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my latest result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannEls_0-1637835825871.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67422iD45A8AEEDAC44FB9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannEls_0-1637835825871.png" alt="JohannEls_0-1637835825871.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here is a peek at the Data Model:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannEls_1-1637835882429.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67423iDB4EDC0EF9EA6E84/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannEls_1-1637835882429.png" alt="JohannEls_1-1637835882429.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 10:24:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863502#M71262</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T10:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863511#M71263</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6142"&gt;@Or&lt;/a&gt;&amp;nbsp; good catch!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have seen this behavior of key field analysis issue in set analysis earlier also. However, never thought that it could be an issue with versioning. The exact same application gave different results in different versions.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6142"&gt;@Or&lt;/a&gt;&amp;nbsp;, could you please let us know the version of your qs?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 10:45:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863511#M71263</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-11-25T10:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863518#M71264</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt; I tested this with May 2021 Enterprise. I've never tried counting a key field before while also applying set operators (I don't typically need unions / intersects / etc), and I don't really understand why this would happen, but I can't think of any other explanation here. I'm not sure who at Qlik would be the right person to ask, either, or I'd tag them here. &lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14756"&gt;@JohannEls&lt;/a&gt;&amp;nbsp; Please do keep in mind that counting employee names is not a safe approach, since two different employees might have the same name. Instead, I would suggest that you modify the dataset by adding a second, differently-named employee ID to the Employee table:&lt;/P&gt;
&lt;P&gt;Load EmployeeID,&lt;/P&gt;
&lt;P&gt;EmployeeID as EmployeeIDForCount,&lt;/P&gt;
&lt;P&gt;[...]&lt;/P&gt;
&lt;P&gt;From Employees;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would then have an unambiguous field to count that isn't a key to any other table, and hopefully that should give you consistent and correct results.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 10:57:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863518#M71264</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-25T10:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Operators not calculating result correctly</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863527#M71266</link>
      <description>&lt;P&gt;100% - I agree!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 11:07:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Operators-not-calculating-result-correctly/m-p/1863527#M71266</guid>
      <dc:creator>JohannEls</dc:creator>
      <dc:date>2021-11-25T11:07:37Z</dc:date>
    </item>
  </channel>
</rss>

