<?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: Variable by dimension in Aggr in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-by-dimension-in-Aggr/m-p/1852553#M1215726</link>
    <description>&lt;P&gt;try with&lt;/P&gt;
&lt;P&gt;sum(aggr(if(max(TOTAL &amp;lt;code&amp;gt; year)=year, sum(X)), code, year))&lt;/P&gt;</description>
    <pubDate>Wed, 27 Oct 2021 13:37:31 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2021-10-27T13:37:31Z</dc:date>
    <item>
      <title>Variable by dimension in Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-by-dimension-in-Aggr/m-p/1852534#M1215724</link>
      <description>&lt;P&gt;I have the &lt;SPAN&gt;following data and expression :&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;test:&lt;BR /&gt;LOAD *&lt;BR /&gt;inline&lt;BR /&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;year,code,X&lt;BR /&gt;2020,'A',10&lt;BR /&gt;2021,'A',7&lt;BR /&gt;2019,'C',25&lt;BR /&gt;2020,'C',50&lt;BR /&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sum(&lt;BR /&gt;Aggr(&lt;BR /&gt;sum({&amp;lt;year={$(=max(year))}&amp;gt;}&lt;BR /&gt;X&lt;BR /&gt;)&lt;BR /&gt;,code&lt;BR /&gt;)&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want the sum of X for the max year grouped by code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For example here I want 7 + 50 = 57.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Unfortunately my expression gives me 7&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How can I tell the variable $ to take the aggr group into account ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks you,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 13:23:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-by-dimension-in-Aggr/m-p/1852534#M1215724</guid>
      <dc:creator>Ajaj</dc:creator>
      <dc:date>2021-10-27T13:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Variable by dimension in Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-by-dimension-in-Aggr/m-p/1852553#M1215726</link>
      <description>&lt;P&gt;try with&lt;/P&gt;
&lt;P&gt;sum(aggr(if(max(TOTAL &amp;lt;code&amp;gt; year)=year, sum(X)), code, year))&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 13:37:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-by-dimension-in-Aggr/m-p/1852553#M1215726</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2021-10-27T13:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Variable by dimension in Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-by-dimension-in-Aggr/m-p/1852581#M1215727</link>
      <description>&lt;P&gt;Nice, it works perfectly,&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 14:04:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-by-dimension-in-Aggr/m-p/1852581#M1215727</guid>
      <dc:creator>Ajaj</dc:creator>
      <dc:date>2021-10-27T14:04:01Z</dc:date>
    </item>
  </channel>
</rss>

