<?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: Find max of Rangesum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060894#M935423</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This part of the expression is a new feature which is only available in QV12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Max(Aggr(Rangesum(Above(Aggr(Count(DISTINCT If([Departure] = Timestamp, Id)) - Count(DISTINCT If([Arrival] = Timestamp, Id)), (Timestamp, (NUMERIC))), 0, RowNo())), &lt;SPAN style="color: #ff0000;"&gt;(&lt;/SPAN&gt;Timestamp&lt;SPAN style="color: #ff0000;"&gt;, (NUMERIC))&lt;/SPAN&gt;))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Mar 2016 15:22:13 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-03-02T15:22:13Z</dc:date>
    <item>
      <title>Find max of Rangesum</title>
      <link>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060891#M935420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Problem and I have tried different things but I really do not understand why my expression is not working. I have a timetable and count all tasks which happen at one timestamp.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&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;[Departure]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Timestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&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;[Arrival]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Timestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the accumulative sum at each timestamp i use the following expression&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Rangesum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Above&lt;/SPAN&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;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&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;[Departure]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Timestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&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;[Arrival]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Timestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Id&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Timestamp&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), 0, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RowNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;())) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a textbox i want to display the maximum of tasks which happen at the same time. For any reason it does weird things and does not show the correct number (which may be 2 in the attached file). I found this answer (&lt;A href="https://community.qlikview.com/thread/39854" title="https://community.qlikview.com/thread/39854"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;Max Value in rangesum(above(Mark, 0, rowno())) | Qlik Community&lt;/SPAN&gt;&lt;/A&gt; ), but for me it does not work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So please help me!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 14:27:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060891#M935420</guid>
      <dc:creator />
      <dc:date>2016-03-01T14:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Find max of Rangesum</title>
      <link>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060892#M935421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have QlikView 12 on your computer, try this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Max(Aggr(Rangesum(Above(Aggr(Count(DISTINCT If([Departure] = Timestamp, Id)) - Count(DISTINCT If([Arrival] = Timestamp, Id)), (Timestamp, (NUMERIC))), 0, RowNo())), (Timestamp, (NUMERIC))))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 17:31:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060892#M935421</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-01T17:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Find max of Rangesum</title>
      <link>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060893#M935422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I only have QlikView 11.20 (SR 10), so I get the error&amp;nbsp; "')' expected". Do you have any ideas what's wrong with my expression? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 07:32:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060893#M935422</guid>
      <dc:creator />
      <dc:date>2016-03-02T07:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find max of Rangesum</title>
      <link>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060894#M935423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This part of the expression is a new feature which is only available in QV12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Max(Aggr(Rangesum(Above(Aggr(Count(DISTINCT If([Departure] = Timestamp, Id)) - Count(DISTINCT If([Arrival] = Timestamp, Id)), (Timestamp, (NUMERIC))), 0, RowNo())), &lt;SPAN style="color: #ff0000;"&gt;(&lt;/SPAN&gt;Timestamp&lt;SPAN style="color: #ff0000;"&gt;, (NUMERIC))&lt;/SPAN&gt;))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 15:22:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060894#M935423</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-02T15:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find max of Rangesum</title>
      <link>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060895#M935424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The aggr() dimension values are sorted by load order, not in chronological, numeric order.&lt;/P&gt;&lt;P&gt;Hence the chart inter record functions like above() address not the 'correct' timestamp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would need to create the timestamp field values in chronological load order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2016 23:49:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060895#M935424</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-03T23:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Find max of Rangesum</title>
      <link>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060896#M935425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does it matter where i do the sorting? In my production application after loading this data there follow lots of different datasets. And some of them are joined to this table. So i do the sorting best after all modifications?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 07:42:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060896#M935425</guid>
      <dc:creator />
      <dc:date>2016-03-04T07:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Find max of Rangesum</title>
      <link>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060897#M935426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to create the load order of the field you are using in the aggr() dimension in the correct, chronological order.&lt;/P&gt;&lt;P&gt;The load order is determined by the first value appearance in the script execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need to create a field load with the correct order at the beginning of your script (or at least before you load other values of that field), not at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;If your field would contain sequential integer numbers, 1 to 100, but the load script would load them in random order, you could create a dummy table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DUMMY:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD recno() as FIELD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AUTOGENERATE 100;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then load your data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD FIELD,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM ....;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end, you could even drop your first table, the load order will still be kept:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP TABLE DUMMY;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the field should be in correct load order. Check this by creating a list box for FIELD and set sort order to load order asc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2016 20:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-max-of-Rangesum/m-p/1060897#M935426</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-04T20:06:56Z</dc:date>
    </item>
  </channel>
</rss>

