<?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 of alternate states does not work as expected in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982632#M81099</link>
    <description>&lt;P&gt;I suggest to create a new field fo id_client and don't use the key in count expression&lt;/P&gt;</description>
    <pubDate>Mon, 19 Sep 2022 14:36:43 GMT</pubDate>
    <dc:creator>menta</dc:creator>
    <dc:date>2022-09-19T14:36:43Z</dc:date>
    <item>
      <title>Intersection of alternate states does not work as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982572#M81092</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;The subject is actually very simple :&lt;/P&gt;
&lt;P&gt;1. I want to do an intersection with 2 alternate states&lt;EM&gt;&amp;nbsp;: I would like to get the number of customers who ordered something in 2021 &lt;STRONG&gt;AND&lt;/STRONG&gt; in 2022&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;2. For this, I created 2 alternate states : S1 and S2 :&amp;nbsp;&lt;EM&gt;I put the selections "Year=2021" on S1 and "Year=2022" on S2&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;3. When I am calculating the number of customers&amp;nbsp;separately, it &lt;STRONG&gt;works&lt;/STRONG&gt;. As you can see on the table below (columns 2 and 3 of the table : 177 in each year)&lt;/P&gt;
&lt;P&gt;4. But when I am doing the intersection between the both &lt;STRONG&gt;S1 and S2, it does not work&lt;/STRONG&gt; ....&lt;/P&gt;
&lt;P&gt;5. Nevertheless, when I am counting on another field (&lt;STRONG&gt;Customer&lt;/STRONG&gt; : which is in another table), it works !&lt;/P&gt;
&lt;P&gt;Any idea about this issue ? It looks like Qlik does not like the intersection on a keyfield or something like this ...&lt;/P&gt;
&lt;P&gt;Attached you will find the app, the data model and the table &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Antoine Lepoutre&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 13:05:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982572#M81092</guid>
      <dc:creator>Antoine04</dc:creator>
      <dc:date>2022-09-19T13:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of alternate states does not work as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982627#M81098</link>
      <description>&lt;P&gt;Hi, I can't explain this, it should be something with using key fields, also is hard to check when all year combinations returns 177.&lt;/P&gt;
&lt;P&gt;This expression seems to work:&amp;nbsp;Count({S1&amp;lt;id_client=P({S2} id_client)&amp;gt;} distinct id_client)&lt;/P&gt;
&lt;P&gt;But as it always returns 177 I can't be sure if&amp;nbsp; it's really applying year filters as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 14:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982627#M81098</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2022-09-19T14:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of alternate states does not work as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982632#M81099</link>
      <description>&lt;P&gt;I suggest to create a new field fo id_client and don't use the key in count expression&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 14:36:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982632#M81099</guid>
      <dc:creator>menta</dc:creator>
      <dc:date>2022-09-19T14:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of alternate states does not work as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982637#M81101</link>
      <description>&lt;P&gt;Thanks for answering guys &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Indeed, the Dataset isn't the best, I agree.&lt;/P&gt;
&lt;P&gt;I also thought first that was due to the key field but I did another try by having only one table just like this :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Antoine04_0-1663598692671.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/89352iD82069495AA88ABE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Antoine04_0-1663598692671.png" alt="Antoine04_0-1663598692671.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And... it still does not work :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Antoine04_1-1663598735154.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/89353i348346D692A4F6A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Antoine04_1-1663598735154.png" alt="Antoine04_1-1663598735154.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So, my theory is just that it should not be a field in the main table, because then the intersection is empty ...&lt;BR /&gt;Maybe better then to create another id_customer in the customer table in my case.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 14:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982637#M81101</guid>
      <dc:creator>Antoine04</dc:creator>
      <dc:date>2022-09-19T14:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of alternate states does not work as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982644#M81102</link>
      <description>&lt;P&gt;maybe&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;S2&amp;gt;*&amp;lt;S1&amp;gt;} distinct id_client)&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982644#M81102</guid>
      <dc:creator>menta</dc:creator>
      <dc:date>2022-09-19T15:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of alternate states does not work as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982645#M81103</link>
      <description>&lt;P&gt;I did a testing that confirms your thoughs. With this data:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TableA:
LOAD * INLINE [
year,customer
2020,A
2021,A
2020,B
];&lt;/LI-CODE&gt;
&lt;P&gt;Selecting 2020 in S1 and 2021 in S2.&lt;/P&gt;
&lt;P&gt;=count({S1*S2} DISTINCT customer) -&amp;gt; Returns 0.&lt;/P&gt;
&lt;P&gt;If I select 2020 in S1 and S2 returns 2, with 2021 returns 1&lt;/P&gt;
&lt;P&gt;Adding this table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TableB:
LOAD * Inline [
customer, other
A, a
B, b
];&lt;/LI-CODE&gt;
&lt;P&gt;Selecting 2020 in S1 and 2021 in S2.&lt;/P&gt;
&lt;P&gt;=count({S1*S2} DISTINCT customer) -&amp;gt; Returns 0&lt;/P&gt;
&lt;P&gt;=count({S1*S2} DISTINCT other) -&amp;gt; returns 1&lt;/P&gt;
&lt;P&gt;For some reason the table where the field filtered is (year in this case) doesn't have any row in the intersection, may have some reason because there is no row with year 2020 and 2021, so it returns an empty dataset. But going to another table it returns data, meaning that the dataset was not empty.&lt;/P&gt;
&lt;P&gt;BTW,&amp;nbsp;=Count({S1&amp;lt;customer=P({S2} customer)&amp;gt;} distinct customer) works with only TableA.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:10:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982645#M81103</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2022-09-19T15:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of alternate states does not work as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982648#M81104</link>
      <description>&lt;P&gt;Already tried and it does not work. As you can see with this example :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Antoine04_0-1663600407764.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/89356i71BFF2B6DACEBA3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Antoine04_0-1663600407764.png" alt="Antoine04_0-1663600407764.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The really weird thing is that it works in the table.... but not in the KPI.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:14:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982648#M81104</guid>
      <dc:creator>Antoine04</dc:creator>
      <dc:date>2022-09-19T15:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of alternate states does not work as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982651#M81105</link>
      <description>&lt;P&gt;Thanks Ruben,&lt;/P&gt;
&lt;P&gt;I can now sleep on my 2 ears. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:17:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Intersection-of-alternate-states-does-not-work-as-expected/m-p/1982651#M81105</guid>
      <dc:creator>Antoine04</dc:creator>
      <dc:date>2022-09-19T15:17:16Z</dc:date>
    </item>
  </channel>
</rss>

