<?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: Last value using AGGR or in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95952#M765907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the attached qvw:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jun 2018 13:52:41 GMT</pubDate>
    <dc:creator>m_woolf</dc:creator>
    <dc:date>2018-06-29T13:52:41Z</dc:date>
    <item>
      <title>Last value using AGGR or in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95951#M765906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am stuck with an issue and hope someone can assist. &lt;/P&gt;&lt;P&gt;I have a data set with transactions for Accounts. There are many rows per account and they are timestamped. There is also a FLAG to define a active record. &lt;/P&gt;&lt;P&gt;What I need to do is sum the BALANCE for last record, based of the timestamp, for each account where the flag is Y. &lt;/P&gt;&lt;P&gt;Currently I am using "AGGR( Sum({&amp;lt;FLAG={'Y'},[DATE]={'$(=Max(DATE))'}&amp;gt;}BALANCE) ,ACCOUNT)" but that does not work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also wondering if it is possible or 'better' to somehow create a flag in the script that could be used? There is a potential of the data volumes growing and I am afraid of performance in the future if AGGR is used in all the objects. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INLINE table looks as such - but I also attach an example QV app: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ACCOUNT, FLAG, REGION, BALANCE, DATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263101984, N, AA, 83421.79, 2017-10-31 18:27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263101984, Y, AA, 83421.79, 2017-10-31 18:27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263101984, N, AA, 83421.79, 2017-12-05 09:42&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263101984, Y, AA, 83421.79, 2017-12-05 09:42&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263101984, N, AA, 83421.79, 2017-12-05 09:50&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263101984, Y, AA, 83421.79, 2017-12-05 09:50&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263578945, Y, BB, 522467.02, 2017-12-12 12:35&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263578945, Y, BB, 522467.02, 2017-12-12 12:35&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263578945, N, BB, 522467.02, 2017-12-12 12:35&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263578945, Y, BB, 522467.02, 2017-12-15 11:18&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;85263578945, N, BB, 522467.02, 2017-12-15 11:18&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your assistance, so late in the week. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95951#M765906</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Last value using AGGR or in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95952#M765907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the attached qvw:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 13:52:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95952#M765907</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2018-06-29T13:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Last value using AGGR or in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95953#M765908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried this using FirstSortedValue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FLAG = {'Y'}&lt;/SPAN&gt;&amp;gt;}&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;BALANCE, -&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;DATE)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 14:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95953#M765908</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-29T14:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Last value using AGGR or in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95954#M765909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both these options work and return the correct answer.&lt;/P&gt;&lt;P&gt;I see I cannot mark both answers correct, but I do like the solution from m\w because it takes place in the script. &lt;/P&gt;&lt;P&gt;Thank you also Sunny. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jun 2018 05:58:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95954#M765909</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2018-06-30T05:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Last value using AGGR or in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95955#M765910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot. This is exactly what I was looking for. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jun 2018 05:59:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-value-using-AGGR-or-in-the-script/m-p/95955#M765910</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2018-06-30T05:59:18Z</dc:date>
    </item>
  </channel>
</rss>

