<?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: Troubles with Aggr function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669188#M243213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Malec,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added the MonthCalander level to the aggr function, which solved the amounts changing problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make sure to add it in both expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, numbers are only the same as your excel spreadsheet for Jan, Feb and March differ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does that solve your problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fabs(&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL','PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum({&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL','PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}Balance_Referance_Currency) &amp;gt;=0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum({&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL', 'PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}Balance_Referance_Currency),0&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; , Ledger , CalendarYear, &lt;STRONG&gt;CalanderMonth&lt;/STRONG&gt;,Address_Book_Code )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2014 13:59:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-21T13:59:02Z</dc:date>
    <item>
      <title>Troubles with Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669186#M243211</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 am having some difficulties achieving a result using the Aggr function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically i am doing a summation on a field Balance_Referance_Currency for a particular mapping level while the Month is up to the month displayed in the grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for Jan 2013 it is only Jan 2013, for March 2013 it is up to March 2013 (Jan + Feb + March).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in addition to that i want only to sum the balance (Balance_Referance_Currency ) aggregate on the ledger, address_book_code that are greater than 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached you will find a sample for the document and the desired result in the excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To test the scenario. select first only Jan, you will see that for example the Current Assets field is 10403242.66, however when you click on feb the value for Jan is changing and it should not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 10:15:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669186#M243211</guid>
      <dc:creator>maleksafa</dc:creator>
      <dc:date>2014-10-21T10:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669187#M243212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 13:47:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669187#M243212</guid>
      <dc:creator>maleksafa</dc:creator>
      <dc:date>2014-10-21T13:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669188#M243213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Malec,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added the MonthCalander level to the aggr function, which solved the amounts changing problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make sure to add it in both expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, numbers are only the same as your excel spreadsheet for Jan, Feb and March differ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does that solve your problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fabs(&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL','PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum({&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL','PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}Balance_Referance_Currency) &amp;gt;=0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum({&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL', 'PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}Balance_Referance_Currency),0&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; , Ledger , CalendarYear, &lt;STRONG&gt;CalanderMonth&lt;/STRONG&gt;,Address_Book_Code )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 13:59:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669188#M243213</guid>
      <dc:creator />
      <dc:date>2014-10-21T13:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669189#M243214</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;this only solve the problem of numbers changing but i am not getting the result that i want (in the excel).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because we you add the aggregation on the month level it will evaluate the amount of this month if it is positive and take it. however if you take for example in Feb, it should evaluate not Feb amounts alone but the amounts of Jan + Feb combined on Ledger and Address book code level, if this sum is positive it will be added.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 14:07:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669189#M243214</guid>
      <dc:creator>maleksafa</dc:creator>
      <dc:date>2014-10-21T14:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669190#M243215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in that case i would suggest that you add an above() function like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;STRONG&gt;if(isnull(above([Current Assets&amp;nbsp;&amp;nbsp; ])),0,+above([Current Assets&amp;nbsp;&amp;nbsp; ]))+&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;fabs(&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL','PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum({&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL','PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}Balance_Referance_Currency) &amp;gt;=0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum({&amp;lt; Account_Mapping_Level_7&amp;nbsp; ={'CAL', 'PINV', 'CASH'}, CalanderMonth ={"&amp;lt;=$(=max(CalanderMonth))"} &amp;gt;}Balance_Referance_Currency),0&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; , Ledger , CalendarYear, CalanderMonth,Address_Book_Code )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&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;However I do not get the same values as in your excel spreadsheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 14:19:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669190#M243215</guid>
      <dc:creator />
      <dc:date>2014-10-21T14:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669191#M243216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same case, any help ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 07:39:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669191#M243216</guid>
      <dc:creator />
      <dc:date>2014-10-22T07:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669192#M243217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anas, see what i wrote in my reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 08:02:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Troubles-with-Aggr-function/m-p/669192#M243217</guid>
      <dc:creator />
      <dc:date>2014-10-22T08:02:29Z</dc:date>
    </item>
  </channel>
</rss>

