<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313193#M115604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would be interested for the remote support work. You can reach me at &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:k.shivanand@gmail.com"&gt;k.shivanand@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Dec 2012 21:33:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-05T21:33:06Z</dc:date>
    <item>
      <title>Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313176#M115587</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;Can anyone explain me how the Aggr() function works with beautiful example with data in different scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B'coz i'm getting confuse on this functionality. I've gone through the reference manual also..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 16:54:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313176#M115587</guid>
      <dc:creator />
      <dc:date>2011-11-10T16:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313177#M115588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From an earlier post of mine (&lt;A _jive_internal="true" href="https://community.qlik.com/message/70711#70711"&gt;http://community.qlik.com/message/70711#70711&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think of the aggr() function as making a temporary table. For instance, let's say we have this real table of data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Customer, Value&lt;BR /&gt;A, 20&lt;BR /&gt;A, 30&lt;BR /&gt;B, 10&lt;BR /&gt;B, 15&lt;BR /&gt;C, 40&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, as a nonsense requirement, let's say that we're looking for maximum value by customer, and then the minimum of THAT value across customers. Our max value by customer is A=30, B=15, C=40. Our min of those is 15. Note how we built a temporary table with three rows while calculating it. Aggr() is one way to build this temporary table. Our dimension is Customer, and our expression is max(Value). We could build this as a real chart, but instead we want to use it in an expression without doing so. The general format for aggr() is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;aggr(expression, dimensions)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in our case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;aggr(max(Value),Customer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We're trying to extract the minimum from that temporary table, that list of values, so we just enclose it in min():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;min(aggr(max(Value),Customer))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 18:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313177#M115588</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-11-10T18:57:23Z</dc:date>
    </item>
    <item>
      <title>Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313178#M115589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your breify explaination on Aggr() function. Really it is good example to understood where easily. Now i'm clear on this and i need to play on this function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 09:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313178#M115589</guid>
      <dc:creator />
      <dc:date>2011-11-11T09:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313179#M115590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a great explanation.&amp;nbsp; Thank you.&amp;nbsp; Could you take it 1 step further in this example?&amp;nbsp; The table is:&lt;/P&gt;&lt;P&gt;Number, Name, Office, Dept&lt;/P&gt;&lt;P&gt;1, Rich, NY, Staff&lt;/P&gt;&lt;P&gt;2, Rich, NY, Bank&lt;/P&gt;&lt;P&gt;3, Rich, Dallas, Lit&lt;/P&gt;&lt;P&gt;4, Rich, Dallas, Corp&lt;/P&gt;&lt;P&gt;1, Bob, London, Corp&lt;/P&gt;&lt;P&gt;2, Bob, NY, Corp&lt;/P&gt;&lt;P&gt;3, Bob, NY, Lit&lt;/P&gt;&lt;P&gt;7, Bob, DC, Bank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the output from the expression to be the MAX Number, Office and Dept within each Name.&amp;nbsp; So in this example, my output should be:&lt;/P&gt;&lt;P&gt;4, Rich, Dallas, Corp&lt;/P&gt;&lt;P&gt;7, Bob, DC, Bank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help as I am totally stuck?&amp;nbsp; Thanks very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 19:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313179#M115590</guid>
      <dc:creator />
      <dc:date>2012-07-13T19:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313180#M115591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this, you will be using FirstSortedValue function (and not Aggr)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , Max(Number) as MaxNUmber&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , FirstSortedValue(Office,-Number) as LastOffice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , FirstSortedValue(Dept,-Number) as LastDept&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resident (your table) Group By Name;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 22:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313180#M115591</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2012-07-13T22:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313181#M115592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Krishna that you'd use firstsortedvalue() and his exact expressions.&amp;nbsp; If you're just making a single chart, and don't need to make selections on this data, and performance isn't an issue, I'd probably do it all inside of the chart instead of making a data table.&amp;nbsp; Either way, it's the same idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension&amp;nbsp;&amp;nbsp;&amp;nbsp; = Name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression 1 = max(Number)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression 2 = firstsortedvalue(Office,-Number)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression 3 = firstsortedvalue(Dept,-Number)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 19:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313181#M115592</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-07-16T19:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313182#M115593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John, thank you VERY much for the quick accurate response.&amp;nbsp;&amp;nbsp; This is the first time I have used this forum and wow what a great experience.&amp;nbsp; I really appreciate it!&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 20:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313182#M115593</guid>
      <dc:creator />
      <dc:date>2012-07-16T20:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313183#M115594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for the response.&amp;nbsp;&amp;nbsp; This was very helpful!&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 20:03:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313183#M115594</guid>
      <dc:creator />
      <dc:date>2012-07-16T20:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313184#M115595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should probably warn you that the firstsortedvalue() function requires the Name/Number pairs to be unique to return the desired data in this case.&amp;nbsp; So as an example, if you added another row to your data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;7, Bob, London, Lit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'd get nothing back for the office or department for Bob since which value to use is no longer defined.&amp;nbsp; I'm guessing this isn't a problem for your actual data, but if it is, you'd need to define what to do in that case, and the solution would be more complex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 20:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313184#M115595</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-07-16T20:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313185#M115596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way I can contact you directly ? &lt;/P&gt;&lt;P&gt;We (&lt;A href="http://www.youappi.com/"&gt;http://www.youappi.com&lt;/A&gt;) are using qlikview to analyze extensive daily traffic and need some remote highly professional support. Couple of hours a month to review and resolve critical issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure hope we can get some of your wisdom and help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 15:04:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313185#M115596</guid>
      <dc:creator />
      <dc:date>2012-12-03T15:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313186#M115597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not really set up to do billing, but you probably have better options anyway.&amp;nbsp; You could just post questions to the forum, where plenty of experts may be willing to provide their advice.&amp;nbsp; Send me a link to such posts, and if I have the time and the question looks interesting, I'll be happy to give my input.&amp;nbsp; If you need more reliable support than relying on the kindness of strangers, there are a number of QlikView consulting firms ready to serve.&amp;nbsp; I believe many of the top posters work for such firms.&amp;nbsp; Of those posters, I've only actually &lt;EM&gt;worked &lt;/EM&gt;with Rob Wunderlich, who is brilliant, deeply knowledgeable, and a pleasure to work with.&amp;nbsp; But there are a lot of great consultants out there, ready and willing to do whatever you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that you know, this year I've been mostly absent from the forum and have barely touched QlikView.&amp;nbsp; I'm on a fairly different assignment right now.&amp;nbsp; I like to hop on the QlikView forum when time allows to try to keep from forgetting all this, but my time is limited, and I'm more prone to mistakes this year since I'm no longer immersed in it.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're not sure how to send me a link to a post through this site, well, I actually don't either, but people send them to me frequently, so I assume it's simple.&amp;nbsp; I'd rather not give out my direct contact information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 00:10:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313186#M115597</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-12-04T00:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313187#M115598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to get the Min/Min customer name using set analysis.&lt;/P&gt;&lt;P&gt;I have posted the question already.&lt;/P&gt;&lt;P&gt;Do you have a quick solution for pulling customer names from a Min/Max Sales Set Analysis expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 16:44:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313187#M115598</guid>
      <dc:creator />
      <dc:date>2012-12-05T16:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313188#M115599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great explanation, thanks.&amp;nbsp; But can an AGGR "temporary table" work like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do a SUM( IF ..., but want to do it on as few rows as possible.&amp;nbsp; Consider the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM( IF( Month1 &amp;lt;= Month2, AGGR( SUM( Value ), Month1, Month2 ) ) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to do a pre-aggregation before doing the final aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'd expect this to do is to apply the IF comparisons to the AGGR dimensions; ie., do the AGGR once and apply the IF comparisons over the reduced number of rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this how it's supposed to work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried testing it and it seems to help, but I expected better performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 18:50:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313188#M115599</guid>
      <dc:creator />
      <dc:date>2012-12-05T18:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313189#M115600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can explain me this problem, i have a table with this records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type1,value1,value2&lt;/P&gt;&lt;P&gt;A,1,zz&lt;/P&gt;&lt;P&gt;A,2,xy&lt;/P&gt;&lt;P&gt;A,3,jk&lt;/P&gt;&lt;P&gt;B,2,lm&lt;/P&gt;&lt;P&gt;B,1,wx&lt;/P&gt;&lt;P&gt;how i can use the function Aggr to the result are this:&lt;/P&gt;&lt;P&gt;A,zz&lt;/P&gt;&lt;P&gt;B,wx&lt;/P&gt;&lt;P&gt;how you can see i need the records with value1 = 1&lt;/P&gt;&lt;P&gt;Thank's for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:35:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313189#M115600</guid>
      <dc:creator />
      <dc:date>2012-12-05T19:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313190#M115601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;DaveLyon wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...I want to do a SUM( IF ..., but want to do it on as few rows as possible.&amp;nbsp; Consider the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM( IF( Month1 &amp;lt;= Month2, AGGR( SUM( Value ), Month1, Month2 ) ) )&lt;/P&gt;...&lt;P&gt;I expected better performance.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you want the same results as a sum(if(Month1&amp;lt;=Month2,Value)), but were hoping to use aggr() to improve performance?&amp;nbsp; I wouldn't expect it to help.&amp;nbsp; Either way, QlikView must still process ALL of the underlying rows.&amp;nbsp; In your aggr() format, it has to process all of them to sum up the rows for your aggr "temporary table".&amp;nbsp; The sum(if(...)) part might then be fast, but you've already blown all the time in the aggr(sum(...)) part.&amp;nbsp; That's what I suspect is causing it to be slow, in any case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'd probably do is create a new Value field in the script that only exists on the desired rows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(Month1&amp;lt;=Month2,Value) as FlaggedValue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then do a simple sum of that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;sum(FlaggedValue)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe QlikView would only look at the desired rows to do &lt;EM&gt;that &lt;/EM&gt;sum, and so it would perform well, or as well as you're going to get (it won't perform well if 90% of the rows match your condition, but probably nothing would).&amp;nbsp; But if I'm wrong, there are of course other approaches.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 20:44:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313190#M115601</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-12-05T20:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313191#M115602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;johnmarquinez wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;Type1,value1,value2&lt;/P&gt;&lt;P&gt;A,1,zz&lt;/P&gt;&lt;P&gt;A,2,xy&lt;/P&gt;&lt;P&gt;A,3,jk&lt;/P&gt;&lt;P&gt;B,2,lm&lt;/P&gt;&lt;P&gt;B,1,wx&lt;/P&gt;&lt;P&gt;how i can use the function Aggr to the result are this:&lt;/P&gt;&lt;P&gt;A,zz&lt;/P&gt;&lt;P&gt;B,wx&lt;/P&gt;&lt;P&gt;how you can see i need the records with value1 = 1&lt;/P&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's hard to know if this is the best answer with little context, but:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension&amp;nbsp; = Type1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression = only({&amp;lt;value1={1}&amp;gt;} value2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or create a flagged value in the script as mentioned in the previous post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(value1=1,value2) as FlaggedValue&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension&amp;nbsp; = Type1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression = &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;only(FlaggedValue)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 20:49:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313191#M115602</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-12-05T20:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313192#M115603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with John.&amp;nbsp;&amp;nbsp; Having spent a LOT of time working with this since my post months ago....the only way I have found to deal with the situation of having millions of rows of data that need to be operated on in some type of SUM expression is to not use aggr.&amp;nbsp; It is just too slow.&amp;nbsp; The workaound is to create the distinct values in a new column or new table during the LOAD.&amp;nbsp; You should only need to put the values you plan to use within the calculations, as opposed to values you are filtering on in the expression.&amp;nbsp; Hope that makes sense.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 20:52:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313192#M115603</guid>
      <dc:creator />
      <dc:date>2012-12-05T20:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313193#M115604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would be interested for the remote support work. You can reach me at &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:k.shivanand@gmail.com"&gt;k.shivanand@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 21:33:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313193#M115604</guid>
      <dc:creator />
      <dc:date>2012-12-05T21:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313194#M115605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, that's exactly what I wanted to know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem now is that the formula I asked about is an expression in a chart and the Month2 date is a dimension in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 14:10:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313194#M115605</guid>
      <dc:creator />
      <dc:date>2012-12-06T14:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313195#M115606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for you help.&amp;nbsp; Corroboration is always reassuring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll have to think about your comments, but I'll get it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 14:13:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/313195#M115606</guid>
      <dc:creator />
      <dc:date>2012-12-06T14:13:10Z</dc:date>
    </item>
  </channel>
</rss>

