<?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 First or a similar function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150668#M28644</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys, both of your answers were helpful. I used the FirstSortedValue function and also the sample code provided by Michael to use it as I'm relatively new to SQL style commands. Here's what I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Directory;&lt;BR /&gt;LOAD [Order ID],&lt;BR /&gt; FirstSortedValue([Screen Status], [Screen Number]) as 'Original Status'&lt;BR /&gt;FROM Screens.xls (biff, embedded labels, table is [Sheet1$])&lt;BR /&gt;GROUP BY [Order ID];&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jul 2009 20:10:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-30T20:10:13Z</dc:date>
    <item>
      <title>First or a similar function</title>
      <link>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150662#M28638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I have a set of Order data. The fields of interest are Order ID, Screen Number, and Screen status. For each Order ID, there are screen numbers (could be no entries, could be multiple), and each screen number has a Screen Status (screen numbers do not correspond directly to a screen status, meaning that two orders could have screen number 1 triggered, but their screen statuses are not necessarily the same).&lt;/P&gt;&lt;P&gt;What I want to do is get the first Screen status available for an Order, which is the screen status that corresponds to the lowest Screen Number (the first screen number will not necessarily be 1). I'm loading these values from an excel document.&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;Directory;&lt;BR /&gt;First (1)&lt;BR /&gt;LOAD [Order ID],&lt;BR /&gt; [Screen Status] as 'Original Status'&lt;BR /&gt;FROM Screens.xls (biff, embedded labels, table is [Sheet1$]);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;but it only actually loads the first entry in the table, not the first for each Order ID. Anyone know how I can do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 01:27:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150662#M28638</guid>
      <dc:creator />
      <dc:date>2009-07-30T01:27:26Z</dc:date>
    </item>
    <item>
      <title>First or a similar function</title>
      <link>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150663#M28639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i've attached a sample.&lt;/P&gt;&lt;P&gt;Here, order 6 and 8 have a single screen, with different numbers. 7 has no screen, and 9 has 2 screens. What I'd want the load statement to retrieve for each is: 6 - Proceed, 7 - (blank), 8 - Proceed, 9 - secondary questions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 01:45:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150663#M28639</guid>
      <dc:creator />
      <dc:date>2009-07-30T01:45:34Z</dc:date>
    </item>
    <item>
      <title>First or a similar function</title>
      <link>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150664#M28640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for some reason I can't seem to get the attachment to work, here's the table in plain text:&lt;/P&gt;&lt;P&gt;Order ID Screen Number Screen Status&lt;BR /&gt;6 1 Proceed&lt;BR /&gt;7 *blank* *blank*&lt;BR /&gt;8 2 Proceed&lt;BR /&gt;9 2 Secondary Questions&lt;BR /&gt;9 3 Strong advice to change exam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 01:49:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150664#M28640</guid>
      <dc:creator />
      <dc:date>2009-07-30T01:49:58Z</dc:date>
    </item>
    <item>
      <title>First or a similar function</title>
      <link>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150665#M28641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take a look at the finction FirstSortedValue - that should give you what you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 03:07:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150665#M28641</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-07-30T03:07:57Z</dc:date>
    </item>
    <item>
      <title>First or a similar function</title>
      <link>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150666#M28642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan,&lt;BR /&gt;It can be something like this, if I correctly understand what you want:&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Screens:&lt;BR /&gt;LOAD&lt;BR /&gt; [Order ID],&lt;BR /&gt; min([Screen Number]) as FirsrtScreenNumber&lt;BR /&gt;FROM Screens.xls (biff, embedded labels, table is [Sheet1$])&lt;BR /&gt;GROUP BY [Order ID];&lt;BR /&gt;LEFT JOIN LOAD&lt;BR /&gt; [Order ID],&lt;BR /&gt; [Screen Number]) as FirsrtScreenNumber,&lt;BR /&gt; [Screen Status]&lt;BR /&gt;FROM Screens.xls (biff, embedded labels, table is [Sheet1$]);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 03:27:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150666#M28642</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-30T03:27:08Z</dc:date>
    </item>
    <item>
      <title>First or a similar function</title>
      <link>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150667#M28643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I didn't know about the FirstOrderDate. It is much easier with it.&lt;BR /&gt;Thanks Oleg.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 03:36:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150667#M28643</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-30T03:36:34Z</dc:date>
    </item>
    <item>
      <title>First or a similar function</title>
      <link>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150668#M28644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys, both of your answers were helpful. I used the FirstSortedValue function and also the sample code provided by Michael to use it as I'm relatively new to SQL style commands. Here's what I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Directory;&lt;BR /&gt;LOAD [Order ID],&lt;BR /&gt; FirstSortedValue([Screen Status], [Screen Number]) as 'Original Status'&lt;BR /&gt;FROM Screens.xls (biff, embedded labels, table is [Sheet1$])&lt;BR /&gt;GROUP BY [Order ID];&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 20:10:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-or-a-similar-function/m-p/150668#M28644</guid>
      <dc:creator />
      <dc:date>2009-07-30T20:10:13Z</dc:date>
    </item>
  </channel>
</rss>

