<?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: sum a value based on finding the most recent date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510290#M1148012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried the variable expansion without the equal sign as shown above? And, how does your expression show up &lt;EM&gt;exactely &lt;/EM&gt;in the label? I assume your variable 8/7/2013 is evaluated as numeric expression, so it will return a number near zero.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jul 2013 20:14:41 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-07-22T20:14:41Z</dc:date>
    <item>
      <title>sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510282#M1148002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a stock value saved for a number of weeks (aligned in the table with the "week beginning" date). Every week a new value is added with a new date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to produce an expression that will always pick the most recent weeks value to display...and this is what I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;Date={$(=LatestDate)}&amp;gt;}[Value (USD)])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where Latest Date is a variable representing the formula MaxString(Date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot get this to produce a result even though the variable on its own in a text box returns the latest date OK...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody please point me in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 18:43:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510282#M1148002</guid>
      <dc:creator />
      <dc:date>2013-07-22T18:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510283#M1148003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried enclosing your date into single quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;Date={'$(LatestDate)'}&amp;gt;}[Value (USD)])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 18:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510283#M1148003</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-07-22T18:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510284#M1148004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the prompt reply:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just gave it a go with no luck....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I type the actual date between the 2 quotes, I get the correct values returned. It just seems to be the way the formula is interacting with the variable....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 19:04:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510284#M1148004</guid>
      <dc:creator />
      <dc:date>2013-07-22T19:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510285#M1148005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the prompt reply:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just gave it a go with no luck....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I type the actual date between the 2 quotes, I get the correct values returned. It just seems to be the way the formula is interacting with the variable....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 19:04:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510285#M1148005</guid>
      <dc:creator />
      <dc:date>2013-07-22T19:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510286#M1148006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the prompt reply:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just gave it a go with no luck....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I type the actual date between the 2 quotes, I get the correct values returned. It just seems to be the way the formula is interacting with the variable....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 19:05:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510286#M1148006</guid>
      <dc:creator />
      <dc:date>2013-07-22T19:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510287#M1148007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the prompt reply:&lt;/P&gt;&lt;P&gt;Just gave it a go with no luck....&lt;/P&gt;&lt;P&gt;If I type the actual date between the 2 quotes, I get the correct values returned. It just seems to be the way the formula is interacting with the variable....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 19:06:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510287#M1148007</guid>
      <dc:creator />
      <dc:date>2013-07-22T19:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510288#M1148010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you remove the label from your chart expression, QV will show the expression itself, with dollar sign expansion being evaluated. What do you see?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 19:08:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510288#M1148010</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-07-22T19:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510289#M1148011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With my original expression I see “-“. With the variation you have suggested I see the value $0.....(which I guess means the formula syntax is correct, but is not returning the value I expect)....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting closer, but I am still stumped as to why the variable on its own returns the value 8/7/2013, if I input 8/7/2013 into the formula, I get the value I am expecting, but putting the 2 together gives me $0.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 19:15:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510289#M1148011</guid>
      <dc:creator />
      <dc:date>2013-07-22T19:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510290#M1148012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried the variable expansion without the equal sign as shown above? And, how does your expression show up &lt;EM&gt;exactely &lt;/EM&gt;in the label? I assume your variable 8/7/2013 is evaluated as numeric expression, so it will return a number near zero.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 20:14:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510290#M1148012</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-07-22T20:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510291#M1148013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the continued help.....I'll try to cover as many bases here as possible:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I enter the expression: =$(LatestDate) - I get 08/07/2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I enter: =Sum({$&amp;lt;Date={'08/07/2013'}&amp;gt;}[Value (USD)]) - I get $15,000 (ish)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I enter: =Sum({$&amp;lt;Date={'$(LatestDate)'}&amp;gt;}[Value (USD)]) - I get $0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I enter =Sum({$&amp;lt;Date={$(=LatestDate)}&amp;gt;}[Value (USD)]) - I get just - (a dash)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 21:02:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510291#M1148013</guid>
      <dc:creator />
      <dc:date>2013-07-22T21:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: sum a value based on finding the most recent date</title>
      <link>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510292#M1148014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QlikView has a very handy little function for just your kind of issue.&amp;nbsp; You have a list that grows each week with a new date and value.&amp;nbsp; You want to display the most recent value in the list.&amp;nbsp; Hence, your list will be in date order ascending by default with each 'week commencing' date having a different 'value' as in the table below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Week Commencing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&lt;/P&gt;&lt;P&gt;21/07/2013&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;28/07/2013&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;/P&gt;&lt;P&gt;04/08/2013&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 56&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To display your latest value you can use the 'FirstSortedValue' function.&amp;nbsp; Create a text box and type in:&lt;/P&gt;&lt;P&gt;=Firstsortedvalue(Value,-[Week Commencing])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will see the value 56 appear in the text box when you reload the application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you add another line e.g. 11/08/2013 with a value of 76 then reload your application you will see 76 displayed in the text box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function works by taking the first value in a sorted list.&amp;nbsp; The minus sign tells it to look from the end of the list first hence giving you the most recent entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 22:08:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-a-value-based-on-finding-the-most-recent-date/m-p/510292#M1148014</guid>
      <dc:creator />
      <dc:date>2013-07-22T22:08:01Z</dc:date>
    </item>
  </channel>
</rss>

