<?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: Aggregating calculated dimensions for different levels in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507602#M189781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I understand (not sure about it), you want to use aggr(&amp;lt;expression&amp;gt;, Country) or aggr(&amp;lt;expression&amp;gt;, Country, City) depending on the situation controlled by the macro button.&lt;/P&gt;&lt;P&gt;In this case, you can use a conditional expression:&lt;/P&gt;&lt;P&gt;if(&amp;lt;condition&amp;gt;, aggr(&amp;lt;expression&amp;gt;, Country), aggr(&amp;lt;expression&amp;gt;, Country, City))&lt;/P&gt;&lt;P&gt;Or a variable:&lt;/P&gt;&lt;P&gt;aggr(&amp;lt;expression&amp;gt;, $(AggrVar))&lt;/P&gt;&lt;P&gt;Where AggrVar is set by your macro to 'Country' or 'Country, City'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: fixed expression&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Oct 2013 15:54:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-10-03T15:54:02Z</dc:date>
    <item>
      <title>Aggregating calculated dimensions for different levels</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507601#M189780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on a pivot table with one dimension Country, another one City which is visible only when I click on a macro button to show up the detail for City and one calculated dimension which expresses the sales of each Country and - whether I have pressed the button - of each City.&lt;/P&gt;&lt;P&gt;My problem consists in calculating correctly the Sales aggregation for each level (Country or City) because it is a calculated dimension and I can't use the traditional Pick(Dimensionality()....). &lt;/P&gt;&lt;P&gt;In order to not get the error in calculated dimension, the Aggr function is requested, but how can I switch the level of aggregation? Is it possible to do it depending on the dynamic name of the button?&lt;/P&gt;&lt;P&gt;Do you have any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 15:07:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507601#M189780</guid>
      <dc:creator />
      <dc:date>2013-10-03T15:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating calculated dimensions for different levels</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507602#M189781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I understand (not sure about it), you want to use aggr(&amp;lt;expression&amp;gt;, Country) or aggr(&amp;lt;expression&amp;gt;, Country, City) depending on the situation controlled by the macro button.&lt;/P&gt;&lt;P&gt;In this case, you can use a conditional expression:&lt;/P&gt;&lt;P&gt;if(&amp;lt;condition&amp;gt;, aggr(&amp;lt;expression&amp;gt;, Country), aggr(&amp;lt;expression&amp;gt;, Country, City))&lt;/P&gt;&lt;P&gt;Or a variable:&lt;/P&gt;&lt;P&gt;aggr(&amp;lt;expression&amp;gt;, $(AggrVar))&lt;/P&gt;&lt;P&gt;Where AggrVar is set by your macro to 'Country' or 'Country, City'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: fixed expression&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 15:54:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507602#M189781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-03T15:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating calculated dimensions for different levels</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507603#M189782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to do as you suggest me. I used the conditional expression:&lt;/P&gt;&lt;P&gt;if(&amp;lt;condition&amp;gt;, aggr(&amp;lt;expression&amp;gt;, Country, City), aggr(&amp;lt;expression&amp;gt;, Country, City))&lt;BR /&gt; but something strange happens. When I analyze data at Country level the data in the calculated dimension aren't displayed. I don't know where the mistake is.&lt;/P&gt;&lt;P&gt;My formula is =if(vCity = 0, aggr(sum(Sales), Country),aggr(sum(Sales), Country, City))&lt;/P&gt;&lt;P&gt;I'm going to explain how I manage my button in order to show/hide the column City.&lt;BR /&gt;vCity is my variable set up to 1&lt;BR /&gt;For the City dimension I set up Enable Dimension vCity = 1. My macro is working based on this action: =if(vCity = 1,0,1)&lt;BR /&gt;When I press on button, the new column City appears and the sales are aggregated by City, but when I press again the button to collapse the City column and to show up the sales only at Country level, the sales values disappear. I can only visualize a hyphen.&lt;BR /&gt;If I add a new column containing aggr(sum(Sales), Country), it works...I don't understand why doesn't work in my formula.&lt;BR /&gt;Do you have any idea?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2013 10:40:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507603#M189782</guid>
      <dc:creator />
      <dc:date>2013-10-07T10:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating calculated dimensions for different levels</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507604#M189783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cristina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not clear to me why the problem is.&amp;nbsp; If the expression &lt;EM&gt;aggr(sum(Sales),Country)&lt;/EM&gt; works, than the conditional version should work as well (given the condition is correct).&amp;nbsp; Can you attach an example of your application?&lt;/P&gt;&lt;P&gt;If not, you can use a completely different aproach - conditionally enable of dimenstions and expressions.&amp;nbsp; That is, show City dimensions in vCity=1.&amp;nbsp; As for the expressions, create two but show one at a time:&lt;BR /&gt;aggr(sum(Sales), Country, City)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - enable if vCity=1&lt;/P&gt;&lt;P&gt;aggr(sum(Sales), Country)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - enable if vCity=0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are often many ways to get what you want in QV.&amp;nbsp; Hope something will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2013 13:05:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-calculated-dimensions-for-different-levels/m-p/507604#M189783</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-07T13:05:23Z</dc:date>
    </item>
  </channel>
</rss>

