<?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 Partial sum in a table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144478#M23400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you should use something to define the aggregation mode of the information you want to sum up.&lt;/P&gt;&lt;P&gt;Note: if you are interested there is an Italian forum here in the community where you can post your request and directly in italian.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 May 2009 17:57:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-05-19T17:57:08Z</dc:date>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144477#M23399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to all,&lt;/P&gt;&lt;P&gt;I have a problem to calculate a partial sum in a simple table. I need to sum (for example) the first 3 values, excluding the last 2.&lt;/P&gt;&lt;P&gt;The table is:&lt;/P&gt;&lt;P&gt;1st col. id&lt;/P&gt;&lt;P&gt;2nd col tariffa&lt;/P&gt;&lt;P&gt;ID TARIFFA&lt;/P&gt;&lt;P&gt;160 1534,56&lt;/P&gt;&lt;P&gt;160 1534,56&lt;/P&gt;&lt;P&gt;160 754,90&lt;/P&gt;&lt;P&gt;160 1534,56&lt;/P&gt;&lt;P&gt;160 1534,56&lt;/P&gt;&lt;P&gt;I'm trying in any way (RANGESUM, ABOVE etc.), but I can't reach my target.&lt;/P&gt;&lt;P&gt;I would have my sum as 3824,02 (1534,56+1534,56+754,90) instead of total sum 6893,14.&lt;/P&gt;&lt;P&gt;Please help me. Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 17:52:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144477#M23399</guid>
      <dc:creator />
      <dc:date>2009-05-19T17:52:45Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144478#M23400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you should use something to define the aggregation mode of the information you want to sum up.&lt;/P&gt;&lt;P&gt;Note: if you are interested there is an Italian forum here in the community where you can post your request and directly in italian.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 17:57:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144478#M23400</guid>
      <dc:creator />
      <dc:date>2009-05-19T17:57:08Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144479#M23401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know, I need some kind of aggregation, but this is my problem....I can't find a right aggregation that is able to produce the right result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 15:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144479#M23401</guid>
      <dc:creator />
      <dc:date>2009-05-20T15:35:48Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144480#M23402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at your example, which is the criterion you use to sum the first three elements and then the last two?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 16:54:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144480#M23402</guid>
      <dc:creator />
      <dc:date>2009-05-20T16:54:19Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144481#M23403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;Simply I have a maximum of values to sum (for example 3) for each type of DRG (in the example it's only one type n.160, but I can have different DRG's and I should sum first 3 for each kind), so I must have a partial sum of first 3 values, and "avoid" all the last 2 (or 3, 4.....every last values of the table).&lt;/P&gt;&lt;P&gt;Maybe only to know "where" I'm in the table (how many values I've yet summed, or how many rows I've yet "examinated") could be an help. Infact, I stop summing when I've summed the first 3 TARIFFA values in the first 3 rows.&lt;/P&gt;&lt;P&gt;I hope I was able to explain it in a right way.&lt;/P&gt;&lt;P&gt;Thanx for helping me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.&lt;/P&gt;&lt;P&gt;I can't find Italian Forum. Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 17:10:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144481#M23403</guid>
      <dc:creator />
      <dc:date>2009-05-20T17:10:32Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144482#M23404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for the italian group go here: http://community.qlik.com/groups/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then look for&lt;/P&gt;&lt;H1 class="CommonTitle"&gt;KILQ ITALIA&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 17:22:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144482#M23404</guid>
      <dc:creator />
      <dc:date>2009-05-20T17:22:19Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144483#M23405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your issue is that you have no unique key in your raw data, so a QV table would not know how to seperate and order the records, and thus be able to pick "the first three". By adding a unique key to the data you can now pick the first three and sum them using rangesum with above. Please look at the attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2009 00:27:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144483#M23405</guid>
      <dc:creator />
      <dc:date>2009-05-21T00:27:04Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144484#M23406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eugene your solution sums always the last three recods while passing all the data way down. Unfortunately the example provided is tricky as the numbers, apparently, come to a correct total.&lt;/P&gt;&lt;P&gt;If you change the numbers in the inline table you can see that the script sums the three numbers just above the current position.&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;Table1:&lt;BR /&gt;Load * Inline&lt;BR /&gt;[&lt;BR /&gt;ID, TARIFFA&lt;BR /&gt;160, 10&lt;BR /&gt;160, 20&lt;BR /&gt;160, 30&lt;BR /&gt;160, 40&lt;BR /&gt;160, 50&lt;BR /&gt;170, 100&lt;BR /&gt;170, 200&lt;BR /&gt;170, 300&lt;BR /&gt;170, 400&lt;BR /&gt;170, 500&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;the special sum provide the following results:&lt;/P&gt;&lt;P&gt;10 as 10&lt;BR /&gt;30 as 10 +20&lt;BR /&gt;60 as 10 + 20 + 30&lt;BR /&gt;then&lt;BR /&gt;90 as 20 + 30 + 40&lt;BR /&gt;and so on.&lt;/P&gt;&lt;P&gt;I have produced the following script, even if, in my opinion the approach to this kind of problem is wrong starting in the design phase.&lt;/P&gt;&lt;P&gt;Basically, starting from the good point of Eugene, I have created a flag to identify the first 3 values of each group of IDs.&lt;/P&gt;&lt;P&gt;I'm sure there will be more elegant and easy approach, but this should be a starting point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2009 04:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144484#M23406</guid>
      <dc:creator />
      <dc:date>2009-05-21T04:45:21Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144485#M23407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps this is closer to what you need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rangesum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;(top( TARIFFA,1,3)) &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/3010.Image4.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/3010.Image4.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 01:18:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144485#M23407</guid>
      <dc:creator />
      <dc:date>2009-05-22T01:18:53Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144486#M23408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mmhh easier than thought.&lt;/P&gt;&lt;P&gt;I think this is the right solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 01:30:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144486#M23408</guid>
      <dc:creator />
      <dc:date>2009-05-22T01:30:21Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144487#M23409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;Thnx to all, the solution posted by Eugene ia able to sum first 3 values......but the table data to analyze is more complicated &lt;IMG alt="Stick out tongue" src="http://community.qlik.com/emoticons/emotion-4.gif" /&gt; and the number of values that I have to sum changes every time in reason of the ID number.&lt;/P&gt;&lt;P&gt;So in the script the number three shoudn't be a constant but a variable calculated dynamically for any kind of ID.&lt;/P&gt;&lt;P&gt;Maybe a faster solution is to number every record from 1 to n for every kind of ID:&lt;/P&gt;&lt;P&gt;160 1&lt;/P&gt;&lt;P&gt;160 2&lt;/P&gt;&lt;P&gt;160 3&lt;/P&gt;&lt;P&gt;135 1&lt;/P&gt;&lt;P&gt;135 2&lt;/P&gt;&lt;P&gt;120 1&lt;/P&gt;&lt;P&gt;120 2&lt;/P&gt;&lt;P&gt;160 4&lt;/P&gt;&lt;P&gt;120 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc . , so I could sum the first X values for every kind of ID.&lt;/P&gt;&lt;P&gt;I hope I was able to explain it clearly. &lt;IMG alt="Sad" src="http://community.qlik.com/emoticons/emotion-6.gif" /&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 23:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144487#M23409</guid>
      <dc:creator />
      <dc:date>2009-05-27T23:10:34Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144488#M23410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a forumla that calculates the count of records to sum based on ID, or is it more like a different number for each ID, with no pattern? In the second case the solution would be a seperate mapping table. Let me know, and I can show you how I would do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 00:03:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144488#M23410</guid>
      <dc:creator />
      <dc:date>2009-05-28T00:03:29Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144489#M23411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a formula like this as an expression of my graph table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count( IF( CONDITION, ID) )&lt;/P&gt;&lt;P&gt;that count how many IDs are admissible (for each kind of ID) so this is equal to maxiumu number of ID admitted to calculate sum, even if in the table I have more IDs.&lt;/P&gt;&lt;P&gt;So for every kind of ID i have a limit in summing values.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2009 15:18:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144489#M23411</guid>
      <dc:creator />
      <dc:date>2009-05-29T15:18:58Z</dc:date>
    </item>
    <item>
      <title>Partial sum in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144490#M23412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use a formula like the one you included in your post, not in the dimension, but instead inside an aggr function which would be the third argument to this "top" function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rangesum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(top( TARIFFA,1,3))&lt;/P&gt;&lt;P&gt;The dimension for the aggr function would likely be ID. If you need more help attach your qvw with some notes.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 21:00:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sum-in-a-table/m-p/144490#M23412</guid>
      <dc:creator />
      <dc:date>2009-06-01T21:00:06Z</dc:date>
    </item>
  </channel>
</rss>

