<?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: Problem with FirstSortedValue when dealing with repeated values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534775#M1141699</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;There two ways: datamodel changing or complex expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;f you're sure that these line are always the same - store it as one line in a separate table. So that you can use standart FirstSortedValue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can write a complex expression with aggr, Max and Only functions, using the same logic as FirstSortedValue. But this approach is not flexible when you need to add different dimensions in your charts.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Aug 2013 07:16:15 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2013-08-27T07:16:15Z</dc:date>
    <item>
      <title>Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534772#M1141696</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 problem with FirstSortedValue. Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp:&lt;/P&gt;&lt;P&gt;load * inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;col1, col2, col3&lt;/P&gt;&lt;P&gt;1, a1, 1000&lt;/P&gt;&lt;P&gt;2,c1, 2000&lt;/P&gt;&lt;P&gt;3, b1, 3000&lt;/P&gt;&lt;P&gt;3,b1,4000&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data as above. And in a text box I have =FirstSortedValue( col2, -col1). A simple expression. I want to get the value of col2 for the maximum value of column 1. As such with the data you see this expression will return null. If I remove the last line, it will return 'b1'. I know for a fact, the combination of col1 and col2 will always be unique. Do we have any work around please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 06:55:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534772#M1141696</guid>
      <dc:creator />
      <dc:date>2013-08-27T06:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534773#M1141697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In expression make Col3 as Decreasing i.e do shortening the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashwani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:01:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534773#M1141697</guid>
      <dc:creator>ashwanin</dc:creator>
      <dc:date>2013-08-27T07:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534774#M1141698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I don't understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:03:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534774#M1141698</guid>
      <dc:creator />
      <dc:date>2013-08-27T07:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534775#M1141699</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;There two ways: datamodel changing or complex expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;f you're sure that these line are always the same - store it as one line in a separate table. So that you can use standart FirstSortedValue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can write a complex expression with aggr, Max and Only functions, using the same logic as FirstSortedValue. But this approach is not flexible when you need to add different dimensions in your charts.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:16:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534775#M1141699</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2013-08-27T07:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534776#M1141700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I go down the separate table route, how do I avoid a link to that table. e.g. in my case if i create a table with just distinct values for col1 and col2 how do I avoid the table from getting linked to the existing tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:22:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534776#M1141700</guid>
      <dc:creator />
      <dc:date>2013-08-27T07:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534777#M1141701</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;&lt;A href="https://community.qlik.com/"&gt;&lt;SPAN class="bold"&gt;firstsortedvalue ([ &lt;SPAN class="bold"&gt;distinct&lt;/SPAN&gt; ] expression [, sort-weight [, n ]]&lt;SPAN class="bold"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;By preceding the sort-value expression with a minus sign, the function will return the last value instead. If more than one value of expression share the same lowest sort-order, the function will return NULL.&lt;/P&gt;&lt;P&gt;Here&amp;nbsp; Inline Table Contain&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;temp:&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;inline&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-size: 9pt; font-family: 'Courier New';"&gt;[&lt;BR /&gt;col1, col2, col3&lt;BR /&gt;1, a1, 1000&lt;BR /&gt;2,c1, 2000&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: green; font-size: 9pt; font-family: 'Courier New';"&gt;3, b1, 3000 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;3,b1,4000&lt;BR /&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If&amp;nbsp; I&amp;nbsp; use Firstsortvalue(col1,-col2) then this will gives blank value. As per function functionality.&lt;/P&gt;&lt;P&gt;If I remove one row. Then my inline function will be&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;temp:&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;load&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;inline&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;[&lt;BR /&gt;col1, col2, col3&lt;BR /&gt;1, a1, 1000&lt;BR /&gt;2,c1, 2000&lt;BR /&gt;3,b1,4000&lt;BR /&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;Firstsortvalue(col1,-col2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The out put will be b1 that is desired out put.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Starwberry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:34:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534777#M1141701</guid>
      <dc:creator />
      <dc:date>2013-08-27T07:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534778#M1141702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes... i believe this function is working like the same.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;The answer is b1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:40:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534778#M1141702</guid>
      <dc:creator />
      <dc:date>2013-08-27T07:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534779#M1141703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mohit. Yes, I understand the problem absolutely. Looking for workarounds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:41:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534779#M1141703</guid>
      <dc:creator />
      <dc:date>2013-08-27T07:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534780#M1141704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there is no workaround, I'll have to get the value of col2 of the latest record in my load script in a variable and use it. But I have kept it as the last resort.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:43:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534780#M1141704</guid>
      <dc:creator />
      <dc:date>2013-08-27T07:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534781#M1141705</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;If there are duplicates then the firstsortedvalue will return a Null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534781#M1141705</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2013-08-27T07:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534782#M1141706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To separate table just give differ field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you want to make it separate ? I thiught it should be connected with the other data through col2 as a key.&lt;/P&gt;&lt;P&gt;So in one table you have col1 and col2. In the other col2 and col3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:47:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534782#M1141706</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2013-08-27T07:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534783#M1141707</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;please find attached file for solution.&amp;nbsp; Hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 08:16:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534783#M1141707</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-08-27T08:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534784#M1141708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan. That is perfect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 05:12:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534784#M1141708</guid>
      <dc:creator />
      <dc:date>2013-08-28T05:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534785#M1141709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;However one question. Any means by which we can do this without the Unique ID surrogate key?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 05:21:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534785#M1141709</guid>
      <dc:creator />
      <dc:date>2013-08-28T05:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FirstSortedValue when dealing with repeated values</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534786#M1141710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Easily:&lt;/P&gt;&lt;P&gt;=Only({&amp;lt;col1={$(=Max(total col1))}&amp;gt;} col2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 08:07:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-FirstSortedValue-when-dealing-with-repeated-values/m-p/534786#M1141710</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2013-08-29T08:07:43Z</dc:date>
    </item>
  </channel>
</rss>

