<?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: Displaying next sorted value where field is not empty in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1654633#M731359</link>
    <description>&lt;P&gt;Here's the final solution I used. Basically you can get the idea from the script.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I made a Mapping Load that looked like this. I set it to load entries where Category is &amp;gt;2 so that some categories with 1 or 2 spaces do not load.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TamesTemp:
Mapping LOAD
Name,
Max(Date) as Max_Datums

Resident tmpTamesT where len(Category)&amp;gt;2
Group by Name;​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Made a new data table.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LastSegment:
NoConcatenate
LOAD Category,
	Date(ApplyMap('TamesTemp',Name,0)) as Max_Datums,
	Date - ApplyMap('TamesTemp',Name,0) as Filter_Value,
	Name,  
	Date
   	
Resident tmpTamesT;​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Made another mapping load.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LastSegment2:
Mapping LOAD Name,
	Category
	
Resident LastSegment where Filter_Value = 0;
Drop table LastSegment;​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Made a final data table, adding field "Last_Segment" which shows the last available Category by date.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ApplyMap('LastSegment2',Name,'nav segmenta') as Last_Segment​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I used Last_Segment field in my chart. Hope somebody can make a use of this.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2019 15:06:52 GMT</pubDate>
    <dc:creator>FakeJupiter</dc:creator>
    <dc:date>2019-12-05T15:06:52Z</dc:date>
    <item>
      <title>Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653454#M731333</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have a table in my source file, say, like this (except not sorted by Date):&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;07.07.2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Anthony&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;06.06.2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Chad&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;05.05.2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Michael&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;04.04.2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Hillel&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;03.03.2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Josh&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;02.02.2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;01.01.2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;12.12.2018&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to achieve is to show the latest category in a chart (straight table) for every Name (which would be the dimension). I figured how to do this by using this expression:&lt;/P&gt;&lt;P&gt;=FirstSortedValue(Category,-Date)&lt;/P&gt;&lt;P&gt;The problem that I encountered is that, as I depicted in the table above, some names don't have respective categories in the latest (by Date) entry / entries. What I would like the table to show is the latest category that is not empty. In this example for John category D would be shown (showed?).&lt;/P&gt;&lt;P&gt;Any help would be much appreciated. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;EDIT:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;We did not manage to find a solution how to achieve what I wanted in the chart settings without stepping into script. However, I got close. Here's a chart expression that worked for me in a simple sample file, but didn't for some reason work in my large and complex target file. In my target file it only returned null values. I figured it had something to do with the use of Aggr function.&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;=FirstSortedValue(Distinct if(isnull(Category)or len(Category)&amp;lt;1,null(),Category),-Aggr(Distinct Date, Category))&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;With the help of&lt;SPAN class="UserName lia-user-name lia-user-rank-Contributor-III"&gt; &lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link"&gt;&lt;SPAN class=""&gt;veidlburkhard I managed to develop a solution via script. I'll post it in this thread.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:48:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653454#M731333</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2024-11-16T01:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653463#M731334</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;FirstSortedValue(if(isnull(Category)or len(Category)&amp;lt;1,null(),Category),-Date)&lt;/P&gt;&lt;P&gt;In AddOns &amp;gt; Data Handling &amp;gt; uncheck include zero values.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 08:33:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653463#M731334</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-12-03T08:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653469#M731335</link>
      <description>&lt;P&gt;Sorry did that on QS.&lt;/P&gt;&lt;P&gt;In QV, presentation &amp;gt; suppress null values.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 08:38:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653469#M731335</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-12-03T08:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653472#M731336</link>
      <description>&lt;P&gt;&lt;FONT color="#808080"&gt;Thanks for the answer.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Is it really necessary to edit the AddOns settings to achieve this? I am developing this QV file for various people, and it has a lot of sheets, tables and charts. Would it be wise to change such a global setting?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;I did, however, change the chart's settings in the Presentation tab to suppress zero values and used the script you provided. It didn't work unfortunately.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;I tried doing that, it didn't work.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 08:48:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653472#M731336</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T08:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653473#M731337</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Did you apply this expression?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FirstSortedValue(if(isnull(Category)or len(Category)&amp;lt;1,null(),Category),-Date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am working fine without null values displayed:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MC.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24794iB97D9D6C31EFBFC7/image-size/large?v=v2&amp;amp;px=999" role="button" title="MC.PNG" alt="MC.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 08:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653473#M731337</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-12-03T08:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653477#M731338</link>
      <description>&lt;P&gt;Yes. It gives me the same result as the basic formula in my original post.&lt;/P&gt;&lt;P&gt;Here's my chart presentation settings just in case. The column "Servisa prioritāte"&amp;nbsp; = "Category" in my example.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 643px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24795i18F73F6B5D24EAC1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 08:53:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653477#M731338</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T08:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653478#M731339</link>
      <description>&lt;P&gt;Can you screenshot your dimensions and expressions tab?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 08:55:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653478#M731339</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-12-03T08:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653509#M731340</link>
      <description>&lt;P&gt;Sure. In Dimensions "Serviss" equals "Name" in my example.&lt;BR /&gt;In Expressions "Servisa prioritāte" equals "Category" in my example.&lt;/P&gt;&lt;P&gt;I figured out that for your example to work, I must also:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use a date dimension in my chart&lt;/LI&gt;&lt;LI&gt;I can't have another Expression [Lietu sk.] which counts how many cases (row entries) there are for each name (Serviss). The formula is a simple "=Count([Lietas Nr.])".&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Is there any way I can do this with only the Serviss (Name) dimension and having the count expression as well?&lt;/P&gt;&lt;P&gt;Posting the screenshots below:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Dec 2019 10:22:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653509#M731340</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T10:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653531#M731341</link>
      <description>&lt;P&gt;I'll try adding screenshots to this post, but my last reply with screenshots got marked as spam for some reason.&lt;/P&gt;&lt;P&gt;Basically, I found out that your solution works, but I have to add Date to dimensions and I can't have a count expression in addition to the FirstSortedValue expression that counts the total entries (rows) in the data set.&lt;/P&gt;&lt;P&gt;Is there any way to achieve the same result, but without having to add Date dimension and having the additional count expression?&lt;/P&gt;&lt;P&gt;Serviss = Name&lt;BR /&gt;Servisa prioritāte = Category&lt;/P&gt;&lt;P&gt;In your solution also there will be several rows for the Name. However, what I would like to, is to have only one row for each name and for it to show the latest (by date) Category available, meaning the latest category entry for the Name that is not zero or empty.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24802i9B6CDA6429B3D736/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24803i5F8CACEFE1F0EB5E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 10:34:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653531#M731341</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T10:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653573#M731342</link>
      <description>&lt;P&gt;Instead of adding the category as expression,&lt;/P&gt;&lt;P&gt;Create a calculated dimension and try this:&lt;/P&gt;&lt;P&gt;=aggr(FirstSortedValue(if(isnull(Category)or len(Category)&amp;lt;1,null(),Category),-Date),Date)&lt;/P&gt;&lt;P&gt;Suppress null value at presentation layer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MC.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24813i581029AF0A2D38C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="MC.PNG" alt="MC.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Arthur Fong&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:19:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653573#M731342</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-12-03T12:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653577#M731343</link>
      <description>&lt;P&gt;This doesn't really work for me, because I need to only have each name appear once. In your example John appears twice. Basically, what I need is a list of all names (unique) and their most recent category, which is not empty, but an actual category.&lt;/P&gt;&lt;P&gt;In the actual file I'm developing, I seek to show the list of all car services and the category they belong to. This category can change over time; therefore, I need to show the latest category. However, in some cases the latest entry / entries for the car service have category field missing, so I at least would like to assign the latest available category the car service had in the previous records (lines).&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:52:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653577#M731343</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T12:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653586#M731344</link>
      <description>&lt;P&gt;Try this in calculated dimension:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=aggr(FirstSortedValue(if(isnull(Category)or len(Category)&amp;lt;1,null(),Category),-Date),Name)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 13:08:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653586#M731344</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-12-03T13:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653594#M731345</link>
      <description>&lt;P&gt;Still doesn't work.&lt;/P&gt;&lt;P&gt;I made a simple load for the example as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Data:
Load * inline [
Name|Category|Date
John||06.06.2019
Chad|B|05.05.2019
John|C|04.04.2019
John|D|03.04.2019
Chad||01.01.2019
Chad|U|29.12.2018
] (delimiter is '|');&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The result is as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 306px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24814iA9495893ABAECA3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I check "Suppress when value is null" at the Dimension tab for the calculated dimension, "John" disappears.&lt;BR /&gt;At Presentation tab all "Suppres Zero-Values" are checked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 13:28:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653594#M731345</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T13:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653610#M731346</link>
      <description>&lt;P&gt;Try this at calculated dimension:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MC.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24819iDCE0CDC86C778FBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="MC.PNG" alt="MC.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;=aggr(FirstSortedValue(Category,if(ISNULL(Category)or len(Category)&amp;lt;1,null(),-Date)),Name)&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 13:57:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653610#M731346</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-12-03T13:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653625#M731347</link>
      <description>&lt;P&gt;This seems to work in the example load and table, but for some reason doesn't work in the actual file I need it to work in.&lt;/P&gt;&lt;P&gt;I checked all "Suppress Zero-Value" boxes, they all match.&lt;/P&gt;&lt;P&gt;I don't know what else to look for. In the main file, I also use 2 dimensions - Serviss (analogue to Name) and the calculated dimension that you posted. Naturally, I replaced all the field names as necessary. I have only 1 Expression that is "=count([Lietas Nr.])" which basically is the same thing as "=count(Date)". Here is my version of the calculated dimension with the appropriate field names for the main file:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333333"&gt;=aggr(FirstSortedValue([Servisa prioritāte],if(ISNULL([Servisa prioritāte])or len([Servisa prioritāte])&amp;lt;1,null(),-[Saskaņošanas datums])),Serviss)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;In case you might find it of any use, I posted the tables from the main file below. On the left I have the table where I used the simple expression from my original post to show category ("Servisa prioritāte"), and on the right I have the table that uses the calculated dimension you provided. Obviously, the tables look the same, unfortunately.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 944px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24821i98F286239A6740B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;EDIT: What I just noticed is that in some cases it actually does work. In the table above to the right one row has what I need in the category (Servisa prioritāte) field. I can't figure out why it doesn't work in other cases though.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 14:43:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653625#M731347</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T14:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653629#M731348</link>
      <description>&lt;P&gt;Check if your date is text or numeric format.&lt;/P&gt;&lt;P&gt;Create a listbox and screenshot your date column.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 14:48:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653629#M731348</guid>
      <dc:creator>Arthur_Fong</dc:creator>
      <dc:date>2019-12-03T14:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653630#M731349</link>
      <description>&lt;P&gt;Hi Hoodoo,&lt;/P&gt;&lt;P&gt;why not doing it simple like this:&lt;/P&gt;&lt;P&gt;If(IsNull(Category),FirstSortedValue(Category,-Date, 2), FirstSortedValue(Category,-Date))&lt;/P&gt;&lt;P&gt;and Count(Name)&lt;/P&gt;&lt;P&gt;See the picture:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Test_FirstsortedValue.jpg" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24822iEDA4573B71659A5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Test_FirstsortedValue.jpg" alt="Test_FirstsortedValue.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Happy qliking&lt;/P&gt;&lt;P&gt;Burkhard&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 14:49:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653630#M731349</guid>
      <dc:creator>veidlburkhard</dc:creator>
      <dc:date>2019-12-03T14:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653644#M731350</link>
      <description>&lt;P&gt;All dates seem to be in date format. I checked through the whole list box and the source file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 196px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24823i4DC6A86B7D7A5F87/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have a suspicion that it might have something to do with the data from the source file. In one of the cases where your provided calculated dimension doesn't work, it, as well as the short formula from my original post should work, as the source file did not have latest by date category field empty. So why does it return a "-"?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 15:08:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653644#M731350</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T15:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653656#M731351</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;I encountered two problems with this approach.&lt;/P&gt;&lt;P&gt;One is that, if I understood the function properly, it wouldn't work if the second newest (by Date) Category would also be empty. In my real case not example I have some cases where in the source file there are, for instance, a total of 500 rows with the same Name, but the latest 50 don't have a category.&lt;/P&gt;&lt;P&gt;The second is that for some reason it works on the sample table I provided in my original post, but doesn't work on the example I provided afterwards.&lt;/P&gt;&lt;P&gt;When I have load as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Data:
Load * inline [
Name|Category|Date
John||06.06.2019
Chad|B|05.05.2019
John|C|04.04.2019
John|D|03.04.2019
Chad||01.01.2019
Chad|U|29.12.2018
] (delimiter is '|');&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;it returns this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 300px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24824iF4B9854DBD3467D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 15:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653656#M731351</guid>
      <dc:creator>FakeJupiter</dc:creator>
      <dc:date>2019-12-03T15:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying next sorted value where field is not empty</title>
      <link>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653677#M731352</link>
      <description>&lt;P&gt;Hi Hoodoo,&lt;/P&gt;&lt;P&gt;if this is so, you have to calculate a Category Flag in your script in order to identify the empty categories:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;Name,&lt;BR /&gt;Category,&lt;BR /&gt;If(IsNull(Category) or Len(Category) = 0, 0, 1) as FlagCat,&lt;BR /&gt;Date;&lt;BR /&gt;Load * inline [&lt;BR /&gt;Name|Category|Date&lt;BR /&gt;John||06.06.2019&lt;BR /&gt;Chad|B|05.05.2019&lt;BR /&gt;John|C|04.04.2019&lt;BR /&gt;John|D|03.04.2019&lt;BR /&gt;Chad||01.01.2019&lt;BR /&gt;Chad|U|29.12.2018&lt;BR /&gt;] (delimiter is '|');&lt;/P&gt;&lt;P&gt;and use this flag in the set analysis of your expression.&lt;/P&gt;&lt;P&gt;See the picture:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Test_FirstsortedValue.jpg" style="width: 939px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24826iAF2464FE38939F88/image-size/large?v=v2&amp;amp;px=999" role="button" title="Test_FirstsortedValue.jpg" alt="Test_FirstsortedValue.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problems.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Burkhard&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 17:14:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Displaying-next-sorted-value-where-field-is-not-empty/m-p/1653677#M731352</guid>
      <dc:creator>veidlburkhard</dc:creator>
      <dc:date>2019-12-03T17:14:38Z</dc:date>
    </item>
  </channel>
</rss>

