<?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 P Function not aggregating as i'd like it to... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795315#M472900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query has been irritating me for a couple of days now. Help would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get a market share calculation right. I have simplified my problem and put it into a QVW demo file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this file you will see that there are 2 stores with 2 separate promotions for a supplier. All i would like to do (as seen in the top straight table) is calculate the Promotional Product vs Total Market. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: the total market is the total category i.e. a=forks, b=knives.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the 'Marketshare Analysis' chart the [Copper Focus Brand Sales] is correct &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/check.png" /&gt;.&lt;/P&gt;&lt;P&gt;The 'Complete Basket Sales' is wrong&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/x.png" /&gt;. Which makes the rest of the chart incorrect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way in which i get a correct Complete Basket is by making the following selection within the model (from cleared state):&lt;/P&gt;&lt;P&gt;1. select a store,&lt;/P&gt;&lt;P&gt;2. select promotionalflag = yes,&lt;/P&gt;&lt;P&gt;3. select supplier = coppercorp,&lt;/P&gt;&lt;P&gt;4. select possible Categories,&lt;/P&gt;&lt;P&gt;5. deselect PromotionalFlag and Supplier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you the directly competing market for the promotional items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is clear to you, it is quite difficult to explain but in my chart - Complete Basket Sales should balance to the above selection criteria but i think the P function is selecting a wider range. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i need to do is somehow aggregate my P function by store...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Dec 2014 12:12:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-12-08T12:12:52Z</dc:date>
    <item>
      <title>P Function not aggregating as i'd like it to...</title>
      <link>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795315#M472900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query has been irritating me for a couple of days now. Help would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get a market share calculation right. I have simplified my problem and put it into a QVW demo file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this file you will see that there are 2 stores with 2 separate promotions for a supplier. All i would like to do (as seen in the top straight table) is calculate the Promotional Product vs Total Market. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: the total market is the total category i.e. a=forks, b=knives.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the 'Marketshare Analysis' chart the [Copper Focus Brand Sales] is correct &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/check.png" /&gt;.&lt;/P&gt;&lt;P&gt;The 'Complete Basket Sales' is wrong&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/x.png" /&gt;. Which makes the rest of the chart incorrect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way in which i get a correct Complete Basket is by making the following selection within the model (from cleared state):&lt;/P&gt;&lt;P&gt;1. select a store,&lt;/P&gt;&lt;P&gt;2. select promotionalflag = yes,&lt;/P&gt;&lt;P&gt;3. select supplier = coppercorp,&lt;/P&gt;&lt;P&gt;4. select possible Categories,&lt;/P&gt;&lt;P&gt;5. deselect PromotionalFlag and Supplier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you the directly competing market for the promotional items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is clear to you, it is quite difficult to explain but in my chart - Complete Basket Sales should balance to the above selection criteria but i think the P function is selecting a wider range. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i need to do is somehow aggregate my P function by store...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2014 12:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795315#M472900</guid>
      <dc:creator />
      <dc:date>2014-12-08T12:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: P Function not aggregating as i'd like it to...</title>
      <link>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795316#M472901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try sum(aggr(sum(Sales), Store, Category, PromotionFlag, Supplier))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2014 13:54:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795316#M472901</guid>
      <dc:creator>mato32188</dc:creator>
      <dc:date>2014-12-08T13:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: P Function not aggregating as i'd like it to...</title>
      <link>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795317#M472902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Unfortunately this is not correct. My current query is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Category = P({1&amp;lt;Supplier = {'coppercorp'},PromotionFlag = {'Yes'}&amp;gt;})&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get all the Categories where there is a Promotional Product. e.g. in Store 1 Category C is not meant to show up because coppercorp did not compete in that Category. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above query seems to be returning all Competing Categories across all Stores ignoring the fact that e.g. Store 1 did not compete in Category C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(sum({$&amp;lt;Category = P({1&amp;lt;Supplier = {'coppercorp'},PromotionFlag = {'Yes'}&amp;gt;})&amp;gt;}Sales),Store))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i think aggr and the P function clash in this instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2014 14:05:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795317#M472902</guid>
      <dc:creator />
      <dc:date>2014-12-08T14:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Re: P Function not aggregating as i'd like it to...</title>
      <link>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795318#M472903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i guess i found it....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2014 19:54:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/P-Function-not-aggregating-as-i-d-like-it-to/m-p/795318#M472903</guid>
      <dc:creator>arthur_dom</dc:creator>
      <dc:date>2014-12-08T19:54:16Z</dc:date>
    </item>
  </channel>
</rss>

