<?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: aggr with variable dimension issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917382#M318030</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px;"&gt;Sum(aggr(if(Rank(Sum({1} Spend))&amp;lt;=20, expression &amp;amp; 'your in top 20', expression),$(vCPSelected)))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2015 10:33:26 GMT</pubDate>
    <dc:creator>perumal_41</dc:creator>
    <dc:date>2015-07-28T10:33:26Z</dc:date>
    <item>
      <title>aggr with variable dimension issue</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917378#M318026</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 expression as follows&lt;/P&gt;&lt;P&gt;if(aggr(Rank(Sum({1} Spend)),Supplier)&amp;lt;=20, expression &amp;amp; 'your in top 20', expression)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above expression is working fine and displaying the expression with message if the selected supplier is in top 20.&lt;/P&gt;&lt;P&gt;But I have to write the similar kind of expressions for Manufacturer , Product, Commodity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so I created a variable like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vCPSelected = if(GetFieldSelections(Commodity)&amp;gt;0,'Commodity',if(GetFieldSelections(Product)&amp;gt;0,'Product',if(GetFieldSelections(Manufacturer)&amp;gt;0,'Manufacturer','Supplier')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I replaced the aggr dimension with the above variable &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;if(aggr(Rank(Sum({1} Spend)),$(vCPSelected))&amp;lt;=20, expression &amp;amp; 'your in top 20', expression) but when I selected a supplier (for eg) in top 20 , I am unable to get the first expression in "if" condition.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;along with this I have also a line saying&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;lt;selected supplier&amp;gt; spend is expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;Note: All these I am using in a text box&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Kiran Kumar&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 10:03:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917378#M318026</guid>
      <dc:creator>kkkumar82</dc:creator>
      <dc:date>2015-07-28T10:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: aggr with variable dimension issue</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917379#M318027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your variable started with "=" it should work. That meant the variable will be evaluated and the result will be used with your aggr-expression and without an equal sign only the expression as string will be applied - in such cases could you use $(='&lt;SPAN style="font-size: 13.3333330154419px;"&gt;$(vCPSelected)').&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Further getfieldselections returned a string of the selected values - if you want to count if there is any selection you need getselectedcount().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 10:22:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917379#M318027</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-07-28T10:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: aggr with variable dimension issue</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917380#M318028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are saying that this is working -&amp;gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;if(aggr(Rank(Sum({1} Spend)),Supplier)&amp;lt;=20, expression &amp;amp; 'your in top 20', expression)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this isn't? -&amp;gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;if(aggr(Rank(Sum({1} Spend)),$(vCPSelected))&amp;lt;=20, expression &amp;amp; 'your in top 20', expression)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you check if your variable &lt;STRONG&gt;$(vCPSelected)&lt;/STRONG&gt; shows '&lt;STRONG&gt;Supplier&lt;/STRONG&gt;' when you have one selected?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 10:28:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917380#M318028</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-28T10:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: aggr with variable dimension issue</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917381#M318029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcus , I used getselectedcount() but in a hurry I typed getcurrentselections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got the solution in the same way as u suggested but I have used like as &lt;/P&gt;&lt;P&gt;$(=$(vCPSelected)) and to show the for eg Supplier is in top 20 , I have used $(vCPSelected).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By using "=" aggr is considering the value of the variable as dimension where as &lt;SPAN style="font-size: 13.3333330154419px;"&gt;$(vCPSelected) is just returning a string&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;which aggr is not treating as dimension.&lt;/SPAN&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>Tue, 28 Jul 2015 10:29:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917381#M318029</guid>
      <dc:creator>kkkumar82</dc:creator>
      <dc:date>2015-07-28T10:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: aggr with variable dimension issue</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917382#M318030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px;"&gt;Sum(aggr(if(Rank(Sum({1} Spend))&amp;lt;=20, expression &amp;amp; 'your in top 20', expression),$(vCPSelected)))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 10:33:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-with-variable-dimension-issue/m-p/917382#M318030</guid>
      <dc:creator>perumal_41</dc:creator>
      <dc:date>2015-07-28T10:33:26Z</dc:date>
    </item>
  </channel>
</rss>

