<?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: aggregate function on values based on last n most recent dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410621#M490711</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;I've made some video tutorials on using FirstSortedValue() function. I hope this will be useful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;A class="loading active_link" href="http://qlikshare.com/392" title="http://qlikshare.com/392"&gt;http://qlikshare.com/392&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;DV&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 14 Oct 2012 11:21:34 GMT</pubDate>
    <dc:creator>IAMDV</dc:creator>
    <dc:date>2012-10-14T11:21:34Z</dc:date>
    <item>
      <title>aggregate function on values based on last n most recent dates</title>
      <link>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410618#M490708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have researched the range and the pick functions and can't quite seem to get this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to produce averages and sums various values based on the "last 10" transactions, where we have a date to evaluate which transactions are the most recent. It's needed as chart expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a transaction table in memory where I have the values to be summed/averaged, and each record also has the date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may be missing something obvious, but it seems the functions available all perform the range lookup AND aggregate on the same field - in my case I want my date to be used to find the range and another field to be the subject of the aggregate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should add that the transaction table is not sorted by this date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I do this without having to create in-memory tables based on a query that returns the a sorted result with a limit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 00:26:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410618#M490708</guid>
      <dc:creator />
      <dc:date>2012-10-13T00:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: aggregate function on values based on last n most recent dates</title>
      <link>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410619#M490709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have figured out how to get the 10nth most recent date (or value) using FirstSortedValue() but I am still stuck on how to apply the aggregate function since using the returned date (it is really a datetime) for a greater than "If" does not work as it may not be unique and the one value on its own does no good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue(valuefield,-datefield, 10)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make things even more complicated I realize that I may not even have 10 records. In this case I need to get the sum or average of what is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I should restate my problem to be to get the average or sum of a value on the Past 10 *or less whichever is greater* transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script query is seeming more immenent - please tell me there is another way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 01:10:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410619#M490709</guid>
      <dc:creator />
      <dc:date>2012-10-13T01:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: aggregate function on values based on last n most recent dates</title>
      <link>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410620#M490710</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;You could use set analysis. There is plenty of examples in the community and QV help.&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;datefield={"&amp;lt;$(=Max(datefield)-10)"}&amp;gt;} valuefield)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 18:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410620#M490710</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-10-13T18:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: aggregate function on values based on last n most recent dates</title>
      <link>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410621#M490711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;I've made some video tutorials on using FirstSortedValue() function. I hope this will be useful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;A class="loading active_link" href="http://qlikshare.com/392" title="http://qlikshare.com/392"&gt;http://qlikshare.com/392&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;DV&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Oct 2012 11:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregate-function-on-values-based-on-last-n-most-recent-dates/m-p/410621#M490711</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2012-10-14T11:21:34Z</dc:date>
    </item>
  </channel>
</rss>

