<?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 Lookup the most recent value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344203#M127113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;New to qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imagine a listing of a baseball players statistics by year.&amp;nbsp; This includes information like the Team that he played for that year, and his stats.&amp;nbsp; My table includes only one record per player per year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to be able to report only the most current team that player plays for.&amp;nbsp; Right now, my expression is =Team , this works when i have the year as a selection in a list box, but I want always the current team to shown, regardless of the list box selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2012 08:44:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-08T08:44:13Z</dc:date>
    <item>
      <title>Lookup the most recent value</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344203#M127113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;New to qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imagine a listing of a baseball players statistics by year.&amp;nbsp; This includes information like the Team that he played for that year, and his stats.&amp;nbsp; My table includes only one record per player per year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to be able to report only the most current team that player plays for.&amp;nbsp; Right now, my expression is =Team , this works when i have the year as a selection in a list box, but I want always the current team to shown, regardless of the list box selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 08:44:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344203#M127113</guid>
      <dc:creator />
      <dc:date>2012-08-08T08:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup the most recent value</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344204#M127114</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;Use the function FirstSortedValue() in either the script or any object. Assuming you have a Date field, in a straight table chart with Player as dimension, then the expression should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13444155681738531" jivemacro_uid="_13444155681738531"&gt;&lt;P&gt;FirstSortedValue(Team, -Date)&lt;/P&gt;&lt;/PRE&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;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 08:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344204#M127114</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-08-08T08:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup the most recent value</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344205#M127115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Miguel, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use FirstSortedValue in my script, and it bombs every time. Here's what I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt;"&gt;EVT_NOTES&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt;"&gt;EVTD_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,1) &lt;/SPAN&gt;&lt;SPAN style="color: #ff8040; font-size: 10pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt;"&gt;EVNote1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; *;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0080ff; font-size: 10pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;SELECT &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [EVT_Type]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[EVT_Reference_ID]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , '{' + UPPER([EVT_Reference_ID]) + '}' AS [AUC_UID] &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[EVTD_Date]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[EVT_USER]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[EVT_NOTES]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[EVT_ID]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&amp;nbsp; CAST(Year(EVTD_Date) AS CHAR(4))+'-'+RIGHT('0' + RTRIM(Cast(MONTH(EVTD_Date) AS CHAR(2))),2) AS YearMonth&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; FROM Webadmin.dbo.Eventlog&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; WHERE [EVT_Type] = 'audit'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If I comment out the LOAD statement, everything works fine. If I leave the LOAD statement in, I get an OLEDB read failure. Why is this happening?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Kevin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 19:26:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344205#M127115</guid>
      <dc:creator />
      <dc:date>2013-05-24T19:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup the most recent value</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344206#M127116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the EVTD_Date field a numeric value? Note that FirstSortedValue() is an aggregation function (will need a GROUP BY) and the second parameter needs to be numeric.&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;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 May 2013 18:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup-the-most-recent-value/m-p/344206#M127116</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2013-05-25T18:54:37Z</dc:date>
    </item>
  </channel>
</rss>

