<?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 How can I get this result with set intersection? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891242#M73441</link>
    <description>&lt;P&gt;I'm trying to track customers who are coming through third-party channels in order to convert them to become our direct customers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This dataset represents sales:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AHMB_2-1644437497243.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71986i8686DA2F52A4CF06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AHMB_2-1644437497243.png" alt="AHMB_2-1644437497243.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;H&lt;/STRONG&gt; stands for Third-party channel.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;M&lt;/STRONG&gt; stands for direct channel.&lt;/P&gt;
&lt;P&gt;My goal is to know those customers who ONLY came to us &lt;STRONG&gt;exclusively through third-part channel&lt;/STRONG&gt; between&amp;nbsp; 2019 to 2021 and then from those, I want to see who has converted to &lt;STRONG&gt;exclusively direct channel in 2022&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;according to the data above,&amp;nbsp; &lt;STRONG&gt;B,C,F and R&lt;/STRONG&gt; were exclusively ordering through third-party channels from 2019 to 2021.&lt;/P&gt;
&lt;P&gt;this is that expression I used to get that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;concat (aggr(only({$&amp;lt;Year={"&amp;gt;=2019&amp;lt;=2021"},Customer=E({&amp;lt;SOURCE-={H},Year={"&amp;gt;=2019&amp;lt;=2021"}&amp;gt;})&amp;gt;} distinct Customer),Customer),',')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now in 2022, from that group of customers, only &lt;STRONG&gt;C &lt;/STRONG&gt;has converted to ordering exclusively directly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to get the expression to return only C but I could not.&amp;nbsp;&amp;nbsp; below is my attempt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;concat (distinct {$
&amp;lt;Year={"&amp;gt;=2019&amp;lt;=2021"},Customer=E({&amp;lt;SOURCE-={H},Year={"&amp;gt;=2019&amp;lt;=2021"}&amp;gt;})&amp;gt; 
* 
&amp;lt;Year={"2022"},Customer=E({&amp;lt;SOURCE={H},Year={"2022"}&amp;gt;})&amp;gt;} Customer,',')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and here is the result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AHMB_3-1644438053635.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71987iF8E4175AB3AF7DBA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AHMB_3-1644438053635.png" alt="AHMB_3-1644438053635.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD * INLINE [
    Year, Customer, SOURCE
    2019, A, H
    2019, A, M
    2019, R, H
    2019, B, H
    2019, C, H
    2020, A, H
    2020, D, M
    2020, C, H
    2020, F, H
    2021, E, M
    2021, C, H
    2021, B, H
    2022, C, M
    2022, B, H
    2022, F, H
    2022, C, M
    2022, R, M
    2022, R, H
    2022, S, H
    2022, Q, M
];
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your help&lt;/P&gt;</description>
    <pubDate>Wed, 09 Feb 2022 20:26:01 GMT</pubDate>
    <dc:creator>AHMB</dc:creator>
    <dc:date>2022-02-09T20:26:01Z</dc:date>
    <item>
      <title>How can I get this result with set intersection?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891242#M73441</link>
      <description>&lt;P&gt;I'm trying to track customers who are coming through third-party channels in order to convert them to become our direct customers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This dataset represents sales:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AHMB_2-1644437497243.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71986i8686DA2F52A4CF06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AHMB_2-1644437497243.png" alt="AHMB_2-1644437497243.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;H&lt;/STRONG&gt; stands for Third-party channel.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;M&lt;/STRONG&gt; stands for direct channel.&lt;/P&gt;
&lt;P&gt;My goal is to know those customers who ONLY came to us &lt;STRONG&gt;exclusively through third-part channel&lt;/STRONG&gt; between&amp;nbsp; 2019 to 2021 and then from those, I want to see who has converted to &lt;STRONG&gt;exclusively direct channel in 2022&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;according to the data above,&amp;nbsp; &lt;STRONG&gt;B,C,F and R&lt;/STRONG&gt; were exclusively ordering through third-party channels from 2019 to 2021.&lt;/P&gt;
&lt;P&gt;this is that expression I used to get that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;concat (aggr(only({$&amp;lt;Year={"&amp;gt;=2019&amp;lt;=2021"},Customer=E({&amp;lt;SOURCE-={H},Year={"&amp;gt;=2019&amp;lt;=2021"}&amp;gt;})&amp;gt;} distinct Customer),Customer),',')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now in 2022, from that group of customers, only &lt;STRONG&gt;C &lt;/STRONG&gt;has converted to ordering exclusively directly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to get the expression to return only C but I could not.&amp;nbsp;&amp;nbsp; below is my attempt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;concat (distinct {$
&amp;lt;Year={"&amp;gt;=2019&amp;lt;=2021"},Customer=E({&amp;lt;SOURCE-={H},Year={"&amp;gt;=2019&amp;lt;=2021"}&amp;gt;})&amp;gt; 
* 
&amp;lt;Year={"2022"},Customer=E({&amp;lt;SOURCE={H},Year={"2022"}&amp;gt;})&amp;gt;} Customer,',')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and here is the result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AHMB_3-1644438053635.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71987iF8E4175AB3AF7DBA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AHMB_3-1644438053635.png" alt="AHMB_3-1644438053635.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD * INLINE [
    Year, Customer, SOURCE
    2019, A, H
    2019, A, M
    2019, R, H
    2019, B, H
    2019, C, H
    2020, A, H
    2020, D, M
    2020, C, H
    2020, F, H
    2021, E, M
    2021, C, H
    2021, B, H
    2022, C, M
    2022, B, H
    2022, F, H
    2022, C, M
    2022, R, M
    2022, R, H
    2022, S, H
    2022, Q, M
];
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your help&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 20:26:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891242#M73441</guid>
      <dc:creator>AHMB</dc:creator>
      <dc:date>2022-02-09T20:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get this result with set intersection?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891296#M73445</link>
      <description>&lt;P&gt;May be try these -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Concat(distinct{&amp;lt;Customer=E({&amp;lt;SOURCE={M},Year={"&amp;gt;=2019&amp;lt;=2021"}&amp;gt;})&amp;gt;}Customer,',')&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Concat(distinct{&amp;lt;Customer=E({&amp;lt;SOURCE={M},Year={"&amp;gt;=2019&amp;lt;=2021"}&amp;gt;})*E({&amp;lt;SOURCE={H},Year={2022}&amp;gt;})&amp;gt;&lt;/P&gt;
&lt;P&gt;}Customer,',')&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 02:46:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891296#M73445</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2022-02-10T02:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get this result with set intersection?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891306#M73447</link>
      <description>&lt;P&gt;I tried both expressions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;expression 1 returns B,C,F,Q,R,S&lt;/P&gt;
&lt;P&gt;expression 2 returns C,Q&lt;/P&gt;
&lt;P&gt;both are not the desired results. &amp;nbsp; It should return only C.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 04:15:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891306#M73447</guid>
      <dc:creator>AHMB</dc:creator>
      <dc:date>2022-02-10T04:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get this result with set intersection?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891453#M73461</link>
      <description>&lt;P&gt;You may try it with multiple conditions-level which are working on top of each other. This could mean to use conditions within the inner and an outer aggregation, Maybe something like this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;concat({&amp;lt;Year={"2022"},Customer=E({&amp;lt;SOURCE={H},Year={"2022"}&amp;gt;})&amp;gt;}
   aggr(
     only({$&amp;lt;Year={"&amp;gt;=2019&amp;lt;=2021"},
             Customer=E({&amp;lt;SOURCE-={H},Year={"&amp;gt;=2019&amp;lt;=2021"}&amp;gt;})&amp;gt;} 
     distinct Customer),
   Customer),
',')&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;- Marcus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 10:43:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891453#M73461</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-02-10T10:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get this result with set intersection?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891504#M73465</link>
      <description>&lt;P&gt;Thank you Marcus, It seems to be working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;may I say, I'm still interested to know why the original expression did not work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 12:58:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891504#M73465</guid>
      <dc:creator>AHMB</dc:creator>
      <dc:date>2022-02-10T12:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get this result with set intersection?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891574#M73475</link>
      <description>&lt;P&gt;I'm not absolutely sure but I think the intended intersection couldn't work with:&lt;/P&gt;
&lt;P&gt;sum({ condition1 * condition2 } value)&lt;/P&gt;
&lt;P&gt;because both conditions exclude each other. This means within a one-level approach you would need to include condition2 within condition1 and therefore in the end applying a single-condition (even if they have multiple sub-conditions which are connected with any operators). I assume that this would be also possible in your case but I believe the logically complexity would be quite high and probably much higher as using a multi-level condition, like the above approach.&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 15:23:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-this-result-with-set-intersection/m-p/1891574#M73475</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-02-10T15:23:14Z</dc:date>
    </item>
  </channel>
</rss>

