<?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: Aggregation - one parameter responds to selection, one ignores in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120377#M8394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the explaination!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2018 12:58:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-08-14T12:58:36Z</dc:date>
    <item>
      <title>Aggregation - one parameter responds to selection, one ignores</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120373#M8390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a retail sales table with transaction number, sales, article code, and promotion name. Each transaction can have multiple articles, and some might be on promotion, some might not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;Transaction No&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;Article Code&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;Sales&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;Promo Name&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;P&gt;147&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;P101&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;P&gt;20&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;$5 off&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;147&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;G101&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;148&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;P102&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;25&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;Spend more get more&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;148&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;G103&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to do a basket analysis for specific promotions. For example, when I select "$5 off", all the transactions that contain this promotion will be selected, in this case Transaction No.147. And all the sales of this transaction - on promotion and not, will be summed up, so $30. I also need the article information&amp;nbsp; in order to do a distribution analysis. So the result I want is like below after selecting the promo "$5 off"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;Transaction No&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;Article Code&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;Promo Basket Sales&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;&lt;P&gt;147&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;P101&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;147&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;G101&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My approach for this was trying to do an aggregation with set analysis, making the sales summing part to ignore the selection. And then aggregate by Transaction No, which responds to the selection of promotion, and then by Article code, which ignores the selection of promotion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My formula is like this:&lt;/P&gt;&lt;P&gt;sum(aggr({&amp;lt;[Promo Name]=&amp;gt;}Sum(Sales),[Transaction No], Concat({&amp;lt;[Promo Name]=&amp;gt;}[Article Code]&amp;amp;' ')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;But it didn't work. Any suggestions on tackling this problem? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 19:14:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120373#M8390</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-08T19:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation - one parameter responds to selection, one ignores</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120374#M8391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This expression should work for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sum( {1&amp;lt;[Transaction No]=P({&amp;lt;[Promo Name]=[Promo Name]&amp;gt;})&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2018-08-09 05_16_33-_!! TEMP - My new sheet _ App overview - Qlik Sense.png" class="jive-image image-1" src="/legacyfs/online/210316_2018-08-09 05_16_33-_!! TEMP - My new sheet _ App overview - Qlik Sense.png" style="height: 280px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 03:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120374#M8391</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-08-09T03:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation - one parameter responds to selection, one ignores</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120375#M8392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Petter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply! Seems like it worked! Could you explain the logic of this function? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 14:46:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120375#M8392</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-09T14:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation - one parameter responds to selection, one ignores</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120376#M8393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The element function named P() gives you the &lt;STRONG&gt;P&lt;/STRONG&gt;ossible values from the set expression that is inside the P() and make them the selected values on the left-hand-side of the assignment (=) operator in the outer set expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it finds the promo names that are the selected promo names&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum( {1&amp;lt;[Transaction No]=P({&amp;lt;&lt;STRONG&gt;[Promo Name]=[Promo Name]&lt;/STRONG&gt;&amp;gt;})&amp;gt;} Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it does an associative selection (Qlik calls this an implicit field value definition) from this onto the transaction numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum( {1&amp;lt;&lt;STRONG&gt;[Transaction No]=P( &lt;/STRONG&gt;{&amp;lt;[Promo Name]=[Promo Name]&amp;gt;} &lt;STRONG&gt;)&lt;/STRONG&gt;&amp;gt;} Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;There are more examples here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;A href="https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/ChartFunctions/SetAnalysis/set-modifiers-implicit-field-value-definitions.htm" title="https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/ChartFunctions/SetAnalysis/set-modifiers-implicit-field-value-definitions.htm"&gt;https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/ChartFunctions/SetAnalysis/set-modifiers-implicit-fiel…&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 08:43:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120376#M8393</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-08-10T08:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation - one parameter responds to selection, one ignores</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120377#M8394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the explaination!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 12:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-one-parameter-responds-to-selection-one-ignores/m-p/120377#M8394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-14T12:58:36Z</dc:date>
    </item>
  </channel>
</rss>

