<?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() giving nulls when more than one value for a user on different days... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-giving-nulls-when-more-than-one-value-for-a/m-p/486411#M555327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please disregard, I pasted a section of the formula into itself somehow or something weird and the formula above is not the one that was in my table expression.&amp;nbsp; Twilight Zone Monday...&amp;nbsp; (I'd delete this if I could, but don't see the option. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Aug 2013 19:19:17 GMT</pubDate>
    <dc:creator>stevelord</dc:creator>
    <dc:date>2013-08-12T19:19:17Z</dc:date>
    <item>
      <title>Firstsortedvalue() giving nulls when more than one value for a user on different days...</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-giving-nulls-when-more-than-one-value-for-a/m-p/486410#M555326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I thought this formula was only supposed to give the most current record for a given user, but it's not,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;firstsortedvalue(if(TestDate&amp;gt;=vCohort1MinDate and TestDate&amp;lt;=vCohort1MaxDate, BMI),-(TestDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is on a straight table like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BMI&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24.30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now User 123 has 2 records on two different days within the date range, but both have the identical BMI value as far as I can see.&amp;nbsp; Firstsortedvalue() shouldn't care either way and should just give me whichever one is most current, but it is not in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a related input box to make selections based on a specified date range (using vMinDate and vMaxDate) that currently matches the date range of the input box used for this table (vCohort1MinDate and vCohort1MaxDate), so it shouldn't be trying to display anything outside the date selection range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, when I add the TestDate field to the table, I get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User&amp;nbsp;&amp;nbsp;&amp;nbsp; TestDate&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;&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; BMI&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/9/2012&amp;nbsp; 2:40:35 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 25.45&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/6/2012 11:28:15 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 25.45&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/6/2012 11:35:58 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24.30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if I take the testdate field back out User 123's BMI drops back to null -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me with my firstsortedvalue function?&amp;nbsp; Firstsortedvalue()'s just supposed to get the first one in the sort order... Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(FYI, The present workaround for me is to leave the testdate field in. export to excel, and remove duplicates there.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 18:53:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-giving-nulls-when-more-than-one-value-for-a/m-p/486410#M555326</guid>
      <dc:creator>stevelord</dc:creator>
      <dc:date>2013-08-12T18:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue() giving nulls when more than one value for a user on different days...</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-giving-nulls-when-more-than-one-value-for-a/m-p/486411#M555327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please disregard, I pasted a section of the formula into itself somehow or something weird and the formula above is not the one that was in my table expression.&amp;nbsp; Twilight Zone Monday...&amp;nbsp; (I'd delete this if I could, but don't see the option. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 19:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-giving-nulls-when-more-than-one-value-for-a/m-p/486411#M555327</guid>
      <dc:creator>stevelord</dc:creator>
      <dc:date>2013-08-12T19:19:17Z</dc:date>
    </item>
  </channel>
</rss>

