<?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 AGGR function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/AGGR-function/m-p/1344095#M29734</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to write an expression that calculates some values based on a sort order that is specified in the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have a "flag" on my data that is 0 or 1. In a table I can use the following expression which sums the flag for every row that is above the "current" row:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;rangesum(above(TOTAL Sum(leave_flag),0,rowno(TOTAL)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;This works just fine when I sort my table on anything I like. I would like an expression that forces the calculation to be based on another specific column (lets say it is a column called "sales"). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I have come across the AGGR function which allows you to do this but I can't work out how to use it do what I want. Should it be immediately before the rangesum function or the above function. Do I even need the above function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #000000;"&gt;Can anyone help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jul 2017 11:10:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-07-20T11:10:20Z</dc:date>
    <item>
      <title>AGGR function</title>
      <link>https://community.qlik.com/t5/App-Development/AGGR-function/m-p/1344095#M29734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to write an expression that calculates some values based on a sort order that is specified in the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have a "flag" on my data that is 0 or 1. In a table I can use the following expression which sums the flag for every row that is above the "current" row:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;rangesum(above(TOTAL Sum(leave_flag),0,rowno(TOTAL)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;This works just fine when I sort my table on anything I like. I would like an expression that forces the calculation to be based on another specific column (lets say it is a column called "sales"). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I have come across the AGGR function which allows you to do this but I can't work out how to use it do what I want. Should it be immediately before the rangesum function or the above function. Do I even need the above function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;SPAN style="color: #000000;"&gt;Can anyone help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 11:10:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/AGGR-function/m-p/1344095#M29734</guid>
      <dc:creator />
      <dc:date>2017-07-20T11:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR function</title>
      <link>https://community.qlik.com/t5/App-Development/AGGR-function/m-p/1344096#M29735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/5065"&gt;Recipe for a Pareto Analysis – Revisited&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives an example where you sort by Sum(Measure) in the Aggr() function. But please note that this is only available in QV12.1 or above and Qlik Sense&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 11:23:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/AGGR-function/m-p/1344096#M29735</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-20T11:23:31Z</dc:date>
    </item>
  </channel>
</rss>

