<?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: FirstSortedValue Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690609#M474005</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks, that was the magical bullet!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Oct 2014 14:58:56 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-09T14:58:56Z</dc:date>
    <item>
      <title>FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690592#M473988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list of customer transactions with columns say Date, Customer ID, Sales Value, Statement Balance etc. For each client, I will have multiple transactions, and sometimes multiple transactions on the same day. In my load script, I have sorted in ascending order Customer ID and then Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to prepare a straight table to Statement balance for each customer. Can anyone assist with the expression I could use in such a table. Firstsortedvalue wont work because there will be multiple transactions for a given client on the same day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 09:36:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690592#M473988</guid>
      <dc:creator />
      <dc:date>2014-10-09T09:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690593#M473989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have attached a spreadsheet with some dummy data. I need to come up with a straight table with just the values in green, i.e. the final balances on that customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 10:44:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690593#M473989</guid>
      <dc:creator />
      <dc:date>2014-10-09T10:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690594#M473990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the criteria to select values in green? Is it based on max TransactionID? Then try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD CustomerID,FirstSortedValue(TransactionID,-TransactionID) As TransactionID,FirstSortedValue(CustomerBalance,-TransactionID) As CustomerBalance, &lt;/P&gt;&lt;P&gt;FirstSortedValue(Date,-TransactionID) As Date Group by CustomerID;&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Date,CustomerID,TransactionID,CustomerBalance&lt;/P&gt;&lt;P&gt;1-Jan-14,Cus - 00,111,0&lt;/P&gt;&lt;P&gt;2-Jan-14,Cus - 00,212,5&lt;/P&gt;&lt;P&gt;3-Jan-14,Cus - 00,301,8&lt;/P&gt;&lt;P&gt;4-Jan-14,Cus - 00,432,5&lt;/P&gt;&lt;P&gt;4-Jan-14,Cus - 00,523,0&lt;/P&gt;&lt;P&gt;6-Jan-14,Cus - 01,645,5&lt;/P&gt;&lt;P&gt;7-Jan-14,Cus - 01,767,10&lt;/P&gt;&lt;P&gt;9-Jan-14,Cus - 01,843,15 &lt;/P&gt;&lt;P&gt;9-Jan-14,Cus - 01,934,20 &lt;/P&gt;&lt;P&gt;9-Jan-14,Cus - 01,102,15 &lt;/P&gt;&lt;P&gt;11-Jan-14,Cus - 01,115,18 &lt;/P&gt;&lt;P&gt;12-Jan-14,Cus - 02,128,20 &lt;/P&gt;&lt;P&gt;13-Jan-14,Cus - 02,130,5 ];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 10:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690594#M473990</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-10-09T10:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690595#M473991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not on transaction ID, but on date, i.e. last transaction on that date i.e. max date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:07:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690595#M473991</guid>
      <dc:creator />
      <dc:date>2014-10-09T11:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690596#M473992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there are multiple transactions on the same day, which transaction is to be returned by the script?&lt;/P&gt;&lt;P&gt;If you have sorted the data in the order you want, you may try using FirstValue() function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:08:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690596#M473992</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2014-10-09T11:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690597#M473993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Herbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why dont you try with Peek function to fectch the last entries of each Customer ID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:08:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690597#M473993</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2014-10-09T11:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690598#M473994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have time along with transaction date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:10:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690598#M473994</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-10-09T11:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690599#M473995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anbu, no I have not imported time, but I could I guess, cause I am working with a time stamp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:28:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690599#M473995</guid>
      <dc:creator />
      <dc:date>2014-10-09T11:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690600#M473996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, no this particular data doesn't have a time stamp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:29:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690600#M473996</guid>
      <dc:creator />
      <dc:date>2014-10-09T11:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690601#M473997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without time how will you identify final balances?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:48:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690601#M473997</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-10-09T11:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690602#M473998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peek function would work, can you illustrate how I would use it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:51:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690602#M473998</guid>
      <dc:creator />
      <dc:date>2014-10-09T11:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690603#M473999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its the last customer entry for that customer ID. Data has already been sorted, so the last transaction will be ok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 11:52:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690603#M473999</guid>
      <dc:creator />
      <dc:date>2014-10-09T11:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690604#M474000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;BaseData2:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _customerid as customerid, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _date as date,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _value value,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(_customerid &amp;lt;&amp;gt; peek('customerid'), 1, 0) as laststateflag&lt;/P&gt;&lt;P&gt;RESIDENT BaseData1&lt;/P&gt;&lt;P&gt;ORDER BY _customerid asc, _date desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LastState:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;customerid,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date as laststatedate,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value as laststate &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;RESIDENT BaseData2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;WHERE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;laststateflag = 1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 12:02:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690604#M474000</guid>
      <dc:creator>manuelreimitz</dc:creator>
      <dc:date>2014-10-09T12:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690605#M474001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If data is already sorted in descending order, then try LastValue()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD CustomerID,LastValue(TransactionID) As TransactionID,LastValue(CustomerBalance) As CustomerBalance,&lt;/P&gt;&lt;P&gt;LastValue(Date) As Date Group by CustomerID;&lt;/P&gt;&lt;P&gt;lOAD * Inline [&lt;/P&gt;&lt;P&gt;Date,CustomerID,TransactionID,CustomerBalance&lt;/P&gt;&lt;P&gt;1-Jan-14,Cus - 00,111,0&lt;/P&gt;&lt;P&gt;2-Jan-14,Cus - 00,212,5&lt;/P&gt;&lt;P&gt;3-Jan-14,Cus - 00,301,8&lt;/P&gt;&lt;P&gt;4-Jan-14,Cus - 00,432,5&lt;/P&gt;&lt;P&gt;4-Jan-14,Cus - 00,523,0&lt;/P&gt;&lt;P&gt;6-Jan-14,Cus - 01,645,5&lt;/P&gt;&lt;P&gt;7-Jan-14,Cus - 01,767,10&lt;/P&gt;&lt;P&gt;9-Jan-14,Cus - 01,843,15&lt;/P&gt;&lt;P&gt;9-Jan-14,Cus - 01,934,20&lt;/P&gt;&lt;P&gt;9-Jan-14,Cus - 01,102,15&lt;/P&gt;&lt;P&gt;11-Jan-14,Cus - 01,115,18&lt;/P&gt;&lt;P&gt;12-Jan-14,Cus - 02,128,20&lt;/P&gt;&lt;P&gt;13-Jan-14,Cus - 02,130,5 ];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 12:03:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690605#M474001</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-10-09T12:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690606#M474002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;right, so peek bydefault fetch last entries.So i guess you have to group it with customer ID, so that you can get last entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 12:09:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690606#M474002</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2014-10-09T12:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690607#M474003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manuel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is getting closer to what I need. Unfortunately the last state flag is coming up as 1 on all the transactions. My customer ID's are alphnumeric eg V126958. Will this affect the ordering?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 13:48:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690607#M474003</guid>
      <dc:creator />
      <dc:date>2014-10-09T13:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690608#M474004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try LastValue()?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 14:01:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690608#M474004</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-10-09T14:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690609#M474005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks, that was the magical bullet!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 14:58:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-Question/m-p/690609#M474005</guid>
      <dc:creator />
      <dc:date>2014-10-09T14:58:56Z</dc:date>
    </item>
  </channel>
</rss>

