<?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 with conditions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940377#M324345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried that already, still gives me a null result. &lt;/P&gt;&lt;P&gt;&lt;IMG alt="POC1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/96354_POC1.jpg" style="height: 83px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;"Activity_rep" is the same field as "NoteTakerID". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried Set Analysis as well: FirstSortedValue({$&amp;lt;[Activity_rep]={CSR}&amp;gt;} Notes, -FullTime), but that didn't work either. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Aug 2015 16:17:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-08-18T16:17:31Z</dc:date>
    <item>
      <title>FirstSortedValue with conditions</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940374#M324342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A db I work with stores its notes in a compressed format. Decompressing is very CPU intensive, so I have stored all the notes in a .qvd file (after decompressing). The QVD file stores, among other things, the ActivityRep (whoever entered the note in the db), the FullTime the note was entered (down to tenths of a second), and the Note as a text field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My users want to see the latest note where the note taker was the CSR assigned to the company. I have a straight table with dimensions Company, CSR, forecast$, etc. One of my expressions is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(HistUser = CSR, FirstSortedValue(FullTime,-FullTime))&amp;nbsp; &amp;lt;- this works fine to give me the last date the CSR called the client&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, now I want to put the note in the chart as well. I tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(NoteTakerID = CSR, FirstSortedValue(Notes, -FullTime)) &amp;lt;- always shows null, even if there are notes that meet the criteria&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I read the above, I think it reads "If the NoteTakerID is the same as the CSR ID in this row, find the most recent note". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my tables, CSR and Company are in one table; NoteTakerID, Notes, and FullTime are in a different table. Is there a way to do this using AGGR()? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 19:46:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940374#M324342</guid>
      <dc:creator />
      <dc:date>2015-08-17T19:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with conditions</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940375#M324343</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;Sample data might be very useful in your case. Can you post some sample data if it is not confidential or dummy your data set to something similar to your original data set?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 19:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940375#M324343</guid>
      <dc:creator>sinanozdemir</dc:creator>
      <dc:date>2015-08-17T19:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with conditions</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940376#M324344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; FirstSortedValue( &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;if(NoteTakerID = CSR,&lt;/SPAN&gt;Notes), -FullTime)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 19:55:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940376#M324344</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-08-17T19:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with conditions</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940377#M324345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried that already, still gives me a null result. &lt;/P&gt;&lt;P&gt;&lt;IMG alt="POC1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/96354_POC1.jpg" style="height: 83px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;"Activity_rep" is the same field as "NoteTakerID". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried Set Analysis as well: FirstSortedValue({$&amp;lt;[Activity_rep]={CSR}&amp;gt;} Notes, -FullTime), but that didn't work either. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 16:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940377#M324345</guid>
      <dc:creator />
      <dc:date>2015-08-18T16:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with conditions</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940378#M324346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since set analysis is evaluated once per chart, not per dimension value, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{$&amp;lt;[Activity_rep]={CSR}&amp;gt;}&amp;nbsp; will not work with CSR being your dimension, unless the chart is limited to a single CSR value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Sinan already stated, some sample data lines that show the structure of your tables would really be helpful, it's quite unclear how your data and tables look like in detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since FirstSortedValue() will show NULL when more than one expression values share the same lowest sort order, you can add DISTINCT qualifier to return a value in that case, like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FirstSortedValue(&lt;STRONG&gt;DISTINCT&lt;/STRONG&gt; {$&amp;lt;[Activity_rep]={CSR}&amp;gt;} Notes, -FullTime)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;But I think key to your issue is to understand how your tables are linked and I seem to haven't understood that really.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Would be best if you could provide a small sample QVW (could contain mock up data values).&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 21:30:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940378#M324346</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-08-18T21:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with conditions</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940379#M324347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FirstSortedValue({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Notes={"&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;NoteTakerID = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;CSR&lt;/SPAN&gt;&lt;/SPAN&gt;"}&lt;/SPAN&gt;&amp;gt;}DISTINCT Notes, -FullTime)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 23:57:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-conditions/m-p/940379#M324347</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-08-18T23:57:51Z</dc:date>
    </item>
  </channel>
</rss>

