<?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 Aggr function issue with p() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-function-issue-with-p/m-p/871730#M304749</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 attached a qvw file below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that I have commodities and suppliers and their spend. I have to calculate their share. I got successful in every thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one of my requirements is like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. when we select a supplier I want to see the commodities who has that selected supplier + all other 5 suppliers,&lt;/P&gt;&lt;P&gt;in my example you can selected aa or bb.&lt;/P&gt;&lt;P&gt;The commodities and suppliers are visible but share is displayed to only that selected supplier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more requirement is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The suppliers list by default I want to see top 5 suppliers based on the spend , and if I select a supplier&lt;/P&gt;&lt;P&gt;&amp;nbsp; Selected supplier + other top five suppliers even though the selected supplier is in top 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2015 08:46:30 GMT</pubDate>
    <dc:creator>kkkumar82</dc:creator>
    <dc:date>2015-04-08T08:46:30Z</dc:date>
    <item>
      <title>Aggr function issue with p()</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-issue-with-p/m-p/871730#M304749</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 attached a qvw file below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that I have commodities and suppliers and their spend. I have to calculate their share. I got successful in every thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one of my requirements is like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. when we select a supplier I want to see the commodities who has that selected supplier + all other 5 suppliers,&lt;/P&gt;&lt;P&gt;in my example you can selected aa or bb.&lt;/P&gt;&lt;P&gt;The commodities and suppliers are visible but share is displayed to only that selected supplier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more requirement is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The suppliers list by default I want to see top 5 suppliers based on the spend , and if I select a supplier&lt;/P&gt;&lt;P&gt;&amp;nbsp; Selected supplier + other top five suppliers even though the selected supplier is in top 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 08:46:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-issue-with-p/m-p/871730#M304749</guid>
      <dc:creator>kkkumar82</dc:creator>
      <dc:date>2015-04-08T08:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function issue with p()</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-issue-with-p/m-p/871731#M304750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At last found the solution for the share expression.&lt;/P&gt;&lt;P&gt;Changed the expression by adding max() function gave me the result what I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for Getting the top 5 suppliers I have used calculated dimension as follows&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount(Supplier) &amp;gt; 0, &lt;/P&gt;&lt;P&gt;&amp;nbsp; if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; AGGR(RANK(Sum({1-$&amp;lt;Commodity=p(Commodity)&amp;gt;}Spend)),[Commodity],[Supplier])&amp;lt;=5 &lt;/P&gt;&lt;P&gt;&amp;nbsp; OR&lt;/P&gt;&lt;P&gt;&amp;nbsp; AGGR(RANK(Sum({$&amp;lt;Commodity=p(Commodity) &amp;gt;}Spend)),[Commodity],[Supplier])&amp;lt;=5, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Supplier) &lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(AGGR(RANK(Sum({1&amp;lt;Commodity=p(Commodity)&amp;gt;}Spend)),[Commodity],[Supplier])&amp;lt;=5, Supplier) &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;/P&gt;&lt;P&gt;sum({1&amp;lt;Commodity = p(Commodity)&amp;gt;}Spend)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;max({1&amp;lt;Commodity = p(Commodity)&amp;gt;}&lt;/STRONG&gt;aggr(NODISTINCT Sum({1&amp;lt;Commodity = p(Commodity)&amp;gt;}Spend),Commodity))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above expression adding max function to the aggr() function gave me the solution and now when I am selecting a supplier it is showing me the selected supplier as well as the other suppliers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 08:43:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-issue-with-p/m-p/871731#M304750</guid>
      <dc:creator>kkkumar82</dc:creator>
      <dc:date>2015-04-09T08:43:22Z</dc:date>
    </item>
  </channel>
</rss>

