<?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() function help - division within an aggr in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-function-help-division-within-an-aggr/m-p/562874#M482533</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though it is quite a tricky AGGR expression, try dividing inside the sum:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;max&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000ff;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;LedgerAccountID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;LedgerThirdPartyID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;TransactionPeriod&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='0-12Month'),&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;Sett_Amount_GBP / &lt;SPAN style="color: #800000; font-family: Arial; font-size: 11px; background-color: #ffffff;"&gt;PremiumDiscountAmount_GBP&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0))&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;LedgerThirdPartyID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;TransactionID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;Instalment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;PremiumSettCcy&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;But if it will work or not will depend on your datamodel (the granularity of the fields you use in the division) and the dimensions in the aggr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Aug 2013 10:29:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-08-07T10:29:12Z</dc:date>
    <item>
      <title>Aggr() function help - division within an aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-help-division-within-an-aggr/m-p/562873#M482532</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 trying to find the maximum % of the field &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sett_Amount_GBP &lt;/SPAN&gt; divided by &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PremiumDiscountAmount_GBP &lt;/SPAN&gt; and I'm struggling with my coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that this works, getting the maximum &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sett_Amount_GBP &lt;/SPAN&gt;per &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LedgerThirdPartyID&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TransactionID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Instalment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PremiumSettCcy &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LedgerAccountID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LedgerThirdPartyID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TransactionPeriod&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='0-12Month'),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sett_Amount_GBP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0))&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LedgerThirdPartyID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TransactionID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Instalment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PremiumSettCcy&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;However when I bring in the division by &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PremiumDiscountAmount_GBP &lt;/SPAN&gt;, I can see that my results aren't correct (checking against the dataset manually)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LedgerAccountID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LedgerThirdPartyID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TransactionPeriod&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='0-12Month'),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sett_Amount_GBP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0))&lt;BR /&gt;/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PremiumDiscountAmount_GBP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;LedgerThirdPartyID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TransactionID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Instalment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PremiumSettCcy&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;Can anyone advise where I'm going wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;CJ&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2013 08:11:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-help-division-within-an-aggr/m-p/562873#M482532</guid>
      <dc:creator />
      <dc:date>2013-08-07T08:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function help - division within an aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-help-division-within-an-aggr/m-p/562874#M482533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though it is quite a tricky AGGR expression, try dividing inside the sum:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;max&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000ff;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;LedgerAccountID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;LedgerThirdPartyID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;TransactionPeriod&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='0-12Month'),&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;Sett_Amount_GBP / &lt;SPAN style="color: #800000; font-family: Arial; font-size: 11px; background-color: #ffffff;"&gt;PremiumDiscountAmount_GBP&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0))&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;LedgerThirdPartyID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;TransactionID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;Instalment&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #800000;"&gt;PremiumSettCcy&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;But if it will work or not will depend on your datamodel (the granularity of the fields you use in the division) and the dimensions in the aggr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2013 10:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-help-division-within-an-aggr/m-p/562874#M482533</guid>
      <dc:creator />
      <dc:date>2013-08-07T10:29:12Z</dc:date>
    </item>
  </channel>
</rss>

