<?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: Top 1 Entry; Order By Errors in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646671#M675883</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;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Loss Mit Steps 999]: &lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;FirstValue([Loan Number]) as [Loan Number], &lt;BR /&gt;FirstValue([ Setup Date]) as [ Setup Date], &lt;BR /&gt;FirstValue([ Step Code]) as [ Step Code], &lt;BR /&gt;Max([Completion Date]) as s367_Dt,&lt;BR /&gt;FirstValue([Record Change Code]) as [Record Change Code]&lt;BR /&gt;FROM&lt;BR /&gt;&lt;S&gt;(qvd)&lt;BR /&gt;where match([ Step Code],'367') &lt;/S&gt;&lt;/P&gt;&lt;P&gt;and match([Record Change Code],'x','c')&lt;/P&gt;&lt;P&gt;Order By&amp;nbsp; [Completion Date] desc ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2014 17:58:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-24T17:58:16Z</dc:date>
    <item>
      <title>Top 1 Entry; Order By Errors</title>
      <link>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646669#M675881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;[Loss Mit Steps 999]:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Loan Number]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[ Setup Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[ Step Code]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Completion Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;s367_Dt&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Record Change Code]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;S&gt;(&lt;/S&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;match&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[ Step Code]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'367')&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;match&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Record Change Code]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'x','c')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Order By&amp;nbsp; &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Completion Date] desc&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I then want to choose the first instance only or the most recent by date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I researched where you can use First (1) &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Completion Date] &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;However when I run the above named code I keep getting garbage after error when I include the Order By statement.&amp;nbsp; When I exclude the Order By Statement, no problems.&amp;nbsp; Ultimatley I wish to get the top 1 record based on the Completion Date.&amp;nbsp; Any ideas here??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 17:30:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646669#M675881</guid>
      <dc:creator />
      <dc:date>2014-06-24T17:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Top 1 Entry; Order By Errors</title>
      <link>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646670#M675882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can only use Order By with a resident load. You're loading data from a qvd so you can't use Order By in that load statement.&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_14036329706457071" jivemacro_uid="_14036329706457071" modifiedtitle="true"&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Loss Mit Steps 999]:&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;&lt;SPAN style="color: #0000ff; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[Loan Number]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[ Setup Date]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[ Step Code]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[Completion Date]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;s367_Dt&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[Record Change Code]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;S&gt;(&lt;/S&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;match&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[ Step Code]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;,'367')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;match&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[Record Change Code]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;,'x','c')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;Result:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;F&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; font-size: 8pt; font-style: inherit; font-weight: inherit; line-height: 12pt;"&gt;irst 1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 8pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;noconcatenate Load * &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #800000; font-style: inherit; font-size: 11px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: inherit;"&gt;resident &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Loss Mit Steps 999]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-size: 11px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: inherit;"&gt;Order by &lt;SPAN style="color: #3d3d3d; font-family: inherit; font-size: 8pt; font-style: inherit; font-weight: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; font-size: 8pt; font-style: inherit; font-weight: inherit; color: #800000;"&gt;s367_Dt desc &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-style: inherit; font-size: 11px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: inherit;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;drop table &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Loss Mit Steps 999];&lt;/SPAN&gt;&lt;/P&gt;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 17:55:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646670#M675882</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-24T17:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Top 1 Entry; Order By Errors</title>
      <link>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646671#M675883</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;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Loss Mit Steps 999]: &lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;FirstValue([Loan Number]) as [Loan Number], &lt;BR /&gt;FirstValue([ Setup Date]) as [ Setup Date], &lt;BR /&gt;FirstValue([ Step Code]) as [ Step Code], &lt;BR /&gt;Max([Completion Date]) as s367_Dt,&lt;BR /&gt;FirstValue([Record Change Code]) as [Record Change Code]&lt;BR /&gt;FROM&lt;BR /&gt;&lt;S&gt;(qvd)&lt;BR /&gt;where match([ Step Code],'367') &lt;/S&gt;&lt;/P&gt;&lt;P&gt;and match([Record Change Code],'x','c')&lt;/P&gt;&lt;P&gt;Order By&amp;nbsp; [Completion Date] desc ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 17:58:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646671#M675883</guid>
      <dc:creator />
      <dc:date>2014-06-24T17:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Top 1 Entry; Order By Errors</title>
      <link>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646672#M675884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jackson, In Qlikview, we can sort the table data only on &lt;STRONG&gt;Resident&lt;/STRONG&gt; Loads only. Please follow below procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEMP:&lt;/P&gt;&lt;P&gt;LOAD * &lt;/P&gt;&lt;P&gt;FROM SOURCETABLE.qvd (qvd) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAIN:&lt;/P&gt;&lt;P&gt;Noconcatenate&lt;/P&gt;&lt;P&gt;LOAD * Resident TEMP Order BY FIELDNAME&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 18:12:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-1-Entry-Order-By-Errors/m-p/646672#M675884</guid>
      <dc:creator />
      <dc:date>2014-06-24T18:12:14Z</dc:date>
    </item>
  </channel>
</rss>

