<?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 Getting the value from last day in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258830#M97747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The last TIME value is '3/1/11 1:00', right? Shouldn't the sum of VAL be 300, then, instead of 900?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you mean to sum the VAL at the last TIME value per Type and ID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could try this in a pivot with dimension Type:&lt;/P&gt;&lt;P&gt;=sum(aggr(if(TIME= maxstring(total&amp;lt;Type,ID&amp;gt; TIME),VAL),Type,ID,TIME))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if your TIME is a recognized Timestamp type with numerical representation, e.g. by using this in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET TimestampFormat='D/M/YY h:mm'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could use FirstSortedValue as your pivot expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr(FirstSortedValue(VAL, -TIME),Type,ID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jan 2012 00:39:12 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-01-09T00:39:12Z</dc:date>
    <item>
      <title>Getting the value from last day</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258827#M97744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello all,&lt;/P&gt;&lt;P&gt;i have a little problem to get the result i want,&lt;/P&gt;&lt;P&gt;i have a table like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="168" style="border-image: initial; height: 170px; width: 318px; border-width: 1px; border-color: #000000; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Type&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;TIME&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;VAL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1/1/11 1:00&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;2/1/11 1:00&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;3/1/11 1:00&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1/1/11 1:00&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;2/1/11 1:00&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to create a pivot table that present the sum of the values for Type A but taking only the last TIME value, &lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;sum&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;900&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have tried set analysis&lt;SPAN style="color: #222222; font-family: arial, sans-serif; line-height: 16px; text-align: -webkit-auto; background-color: #ffffff; font-size: small;"&gt; but no luck, i have tried FirstSortedValue and no luck as well,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; line-height: 16px; text-align: -webkit-auto; background-color: #ffffff; font-size: small;"&gt;any one have an idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; line-height: 16px; text-align: -webkit-auto; background-color: #ffffff; font-size: small;"&gt;thank you all!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jan 2012 18:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258827#M97744</guid>
      <dc:creator />
      <dc:date>2012-01-08T18:03:04Z</dc:date>
    </item>
    <item>
      <title>Getting the value from last day</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258828#M97745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think there might be an issue with the set analysis syntax you are using.&amp;nbsp; I was able to load the table you provided inline and come up with a working expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;Time={'$(=MAXSTRING(Time))'}&amp;gt;} Val)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might differ for you depending on how QlikView is viewing the Time field.&amp;nbsp; You might or might not have to use the quotes or you might need to use MAX rather than MAXSTRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jan 2012 18:55:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258828#M97745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-08T18:55:36Z</dc:date>
    </item>
    <item>
      <title>Getting the value from last day</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258829#M97746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you i will try!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jan 2012 19:14:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258829#M97746</guid>
      <dc:creator />
      <dc:date>2012-01-08T19:14:45Z</dc:date>
    </item>
    <item>
      <title>Getting the value from last day</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258830#M97747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The last TIME value is '3/1/11 1:00', right? Shouldn't the sum of VAL be 300, then, instead of 900?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you mean to sum the VAL at the last TIME value per Type and ID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could try this in a pivot with dimension Type:&lt;/P&gt;&lt;P&gt;=sum(aggr(if(TIME= maxstring(total&amp;lt;Type,ID&amp;gt; TIME),VAL),Type,ID,TIME))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if your TIME is a recognized Timestamp type with numerical representation, e.g. by using this in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET TimestampFormat='D/M/YY h:mm'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could use FirstSortedValue as your pivot expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr(FirstSortedValue(VAL, -TIME),Type,ID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 00:39:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-the-value-from-last-day/m-p/258830#M97747</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-09T00:39:12Z</dc:date>
    </item>
  </channel>
</rss>

