<?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: Using indirect selection in Set Analysis to get the SUM of amount spent in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502335#M103449</link>
    <description>&lt;P&gt;Unfortunately this expression does not work&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2025 07:01:41 GMT</pubDate>
    <dc:creator>AHMB</dc:creator>
    <dc:date>2025-01-22T07:01:41Z</dc:date>
    <item>
      <title>Using indirect selection in Set Analysis to get the SUM of amount spent</title>
      <link>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502290#M103444</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This expression below correctly gives the number of reactivated customers after a gift campaign targeting dormant customers:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Expressoin 1:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=count(DISTINCT{
(
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;lt;$(vDateDormantAfter)"}&amp;gt;
-
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;gt;=$(vDateDormantAfter)&amp;lt;$(vCampaignDate)"}&amp;gt;
)
*
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;gt;=$(vCampaignDate)"}&amp;gt;

}PHONE_NUMBER)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, I'm trying to get the amount spent in our stores after they have been reactivated using the following expression:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Expression 2:&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Sum(
{&amp;lt;
[Campaign Customer] = {1},
ORDER_DATE = {"&amp;gt;=$(vCampaignDate)"},
PHONE_NUMBER = P({
(
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;lt;$(vDateDormantAfter)"}&amp;gt;
-
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;gt;=$(vDateDormantAfter)&amp;lt;$(vCampaignDate)"}&amp;gt;
)
*
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;gt;=$(vCampaignDate)"}&amp;gt;
} PHONE_NUMBER)
&amp;gt;}
ORDER_WITHOUT_TAX_AMOUNT
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this gives a number bigger than expected, so I created a Stright Table and added this expression to the dimension:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Aggr(
    Only({
        (
            &amp;lt;[Campaign Customer]={1}, ORDER_DATE={"&amp;lt;$(vDateDormantAfter)"}&amp;gt;
            - 
            &amp;lt;[Campaign Customer]={1}, ORDER_DATE={"&amp;gt;=$(vDateDormantAfter)&amp;lt;$(vCampaignDate)"}&amp;gt;
        )
        * 
        &amp;lt;[Campaign Customer]={1}, ORDER_DATE={"&amp;gt;=$(vCampaignDate)"}&amp;gt;
    } PHONE_NUMBER),
    PHONE_NUMBER
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This returns the correct phone numbers but it also returns "NULL",&amp;nbsp; and by adding the expression that returns the sum of the amount spent to the table, it turned out the larger than expected amount is coming because of the "Null" value in the dimension.&amp;nbsp; this can be fixed by excluding null in the table properties but how can I do the same for the &lt;STRONG&gt;expressoin 2&lt;/STRONG&gt; ?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 20:04:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502290#M103444</guid>
      <dc:creator>AHMB</dc:creator>
      <dc:date>2025-01-21T20:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using indirect selection in Set Analysis to get the SUM of amount spent</title>
      <link>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502319#M103448</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/116079"&gt;@AHMB&lt;/a&gt;&amp;nbsp;Try using below one.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Sum({
(
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;lt;$(vDateDormantAfter)"}&amp;gt;
-
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;gt;=$(vDateDormantAfter)&amp;lt;$(vCampaignDate)"}&amp;gt;
)
*
&amp;lt;[Campaign Customer]={1},ORDER_DATE={"&amp;gt;=$(vCampaignDate)"}&amp;gt;

}Amount)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Jan 2025 05:23:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502319#M103448</guid>
      <dc:creator>Bhushan_Mahajan</dc:creator>
      <dc:date>2025-01-22T05:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using indirect selection in Set Analysis to get the SUM of amount spent</title>
      <link>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502335#M103449</link>
      <description>&lt;P&gt;Unfortunately this expression does not work&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 07:01:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502335#M103449</guid>
      <dc:creator>AHMB</dc:creator>
      <dc:date>2025-01-22T07:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using indirect selection in Set Analysis to get the SUM of amount spent</title>
      <link>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502336#M103450</link>
      <description>&lt;P&gt;I got it working!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=sum(

{&amp;lt;
ORDER_DATE = {"&amp;gt;=$(vCampaignDate)"},
PHONE_NUMBER={"=count(DISTINCT{
(
&amp;lt;[Campaign Customer]={1},ORDER_DATE={'&amp;lt;$(vDateDormantAfter)'}&amp;gt;
-
&amp;lt;[Campaign Customer]={1},ORDER_DATE={'&amp;gt;=$(vDateDormantAfter)&amp;lt;$(vCampaignDate)'}&amp;gt;
)
*
&amp;lt;[Campaign Customer]={1},ORDER_DATE={'&amp;gt;=$(vCampaignDate)'}&amp;gt;

}PHONE_NUMBER)&amp;gt;0"}

&amp;gt;}
ORDER_WITHOUT_TAX_AMOUNT)


&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The entire "count" expression that was in the P() term becomes a search term.&amp;nbsp; I just needed to convert the inner double quotes to single quotes for it to work. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;what a confusing mess the Set Analysis syntax is .&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 07:09:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-indirect-selection-in-Set-Analysis-to-get-the-SUM-of/m-p/2502336#M103450</guid>
      <dc:creator>AHMB</dc:creator>
      <dc:date>2025-01-22T07:09:05Z</dc:date>
    </item>
  </channel>
</rss>

