<?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: Intersection giving wrong results in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516853#M105838</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/262705"&gt;@Federicofkt&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Could you post a straight table with company id, year, TypeF and company type as dimensions and the two measures?&lt;/P&gt;</description>
    <pubDate>Tue, 06 May 2025 15:18:50 GMT</pubDate>
    <dc:creator>agigliotti</dc:creator>
    <dc:date>2025-05-06T15:18:50Z</dc:date>
    <item>
      <title>Intersection giving wrong results</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516848#M105836</link>
      <description>&lt;P&gt;I'm trying to perform an intersection in the set analysis using this formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=count( {&lt;BR /&gt;&amp;lt;[Company.id] = P({&amp;lt;Year= {'2024'}, TypeF={'REFAZ'}, [Company.Type]={'A'}&amp;gt;})&amp;gt;&lt;BR /&gt;*&lt;BR /&gt;&amp;lt;[Company.id] = P({&amp;lt;Year= {'2025'}, TypeF={'REFAZ'}, [Company.Type]={'A'}&amp;gt;})&amp;gt;&lt;BR /&gt;}&lt;BR /&gt;distinct [Company.id])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula is returning no errors, hence it is giving me wrong results, since if I use the two measures separated in two columns, I have companies with 1 for both 2024 and 2025 that got 0 in the intersection, and companies with 1 in 2025 and 0 in 2025 that got 1 in the intersection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 14:40:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516848#M105836</guid>
      <dc:creator>Federicofkt</dc:creator>
      <dc:date>2025-05-06T14:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection giving wrong results</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516853#M105838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/262705"&gt;@Federicofkt&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Could you post a straight table with company id, year, TypeF and company type as dimensions and the two measures?&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 15:18:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516853#M105838</guid>
      <dc:creator>agigliotti</dc:creator>
      <dc:date>2025-05-06T15:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection giving wrong results</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516872#M105841</link>
      <description>&lt;P&gt;Maybe in this way:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=count({&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;Year= {'2024'}, TypeF={'REFAZ'}, [Company.Type]={'A'} &amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;Year= {'2025'}, TypeF={'REFAZ'}, [Company.Type]={'A'}&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;distinct [Company.id])&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 16:45:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516872#M105841</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-05-06T16:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection giving wrong results</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516882#M105843</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I tested this, and I believe that the issue here is using the ID field for counting. Examine the following screenshot:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Oleg_Troyansky_0-1746554068915.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/180265iDA0C674FA5123070/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Oleg_Troyansky_0-1746554068915.png" alt="Oleg_Troyansky_0-1746554068915.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- The first column is a simple distinct count of the field Customer (which is an attribute in the Customers table) - 199 customers in total&lt;BR /&gt;&lt;BR /&gt;- The second column is the intersection of possible values of the same field Customer, where the intersection is defined within a single Set Modifier &amp;lt;...&amp;gt; - 174 customers.&lt;BR /&gt;&lt;BR /&gt;- The third column is the same condition, where the intersection is defined across two different modifiers: &amp;lt;...&amp;gt; * &amp;lt;...&amp;gt;, and the result is the same as in column 2 - 174 customers.&lt;BR /&gt;&lt;BR /&gt;- Then, testing the idea suggested by Marcus, I simplified the condition to the intersection of two sets, with just the Year conditions, skipping the Customer filters and functions P() - same result.&lt;BR /&gt;&lt;BR /&gt;- Finally, I modified the same expression, replacing the Customer field with the key field [%Customer ID], and that's when the expression turned to zero.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In conclusion - don't use key fields for counting. You may get ambiguous results, and Qlik intentionally prohibits that.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 18:03:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2516882#M105843</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2025-05-06T18:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection giving wrong results</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2517239#M105900</link>
      <description>&lt;P&gt;Yes, I remember I faced the same in the past in an i&lt;SPAN&gt;ntersection&amp;nbsp;scenario.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 07:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-giving-wrong-results/m-p/2517239#M105900</guid>
      <dc:creator>agigliotti</dc:creator>
      <dc:date>2025-05-09T07:33:31Z</dc:date>
    </item>
  </channel>
</rss>

