<?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: expression for second sorted value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637283#M732423</link>
    <description>&lt;P&gt;To see if i could work out some of the expressions i've been playing about with a straight table and i can manage to display the time of the second usage (and third etc) with this:&lt;/P&gt;&lt;P&gt;FirstSortedValue(Into_theatre_Time,Into_theatre_Time,2)&lt;/P&gt;&lt;P&gt;However i can't manage to fit that into the bar chart.&lt;/P&gt;&lt;P&gt;I used the expression of&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirstSortedValue([Length of Time in Theatres],[Length of Time in Theatres],2)&lt;/P&gt;&lt;P&gt;and then used the Bar Offset of&lt;/P&gt;&lt;P&gt;FirstSortedValue(Into_theatre_Time,Into_theatre_Time,2)&lt;/P&gt;&lt;P&gt;but it put the usage miles away from where it should be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Utilisation 2.jpeg" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/21906i203557D819C944ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Utilisation 2.jpeg" alt="Utilisation 2.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2019 15:08:54 GMT</pubDate>
    <dc:creator>peterderrington</dc:creator>
    <dc:date>2019-10-18T15:08:54Z</dc:date>
    <item>
      <title>expression for second sorted value</title>
      <link>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637267#M732421</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to create a chart which shows me the utilisation of a location by using FirstSortedValue. My problem is i now need to be able to display the second (and third and forth and so on) value.&lt;/P&gt;&lt;P&gt;The original data is an excel sheet with each row an individual of which we identify the location and also the time of entry to that location as well as the length of time in that location.&lt;/P&gt;&lt;P&gt;The idea is to ultimately create a chart which will show when the location is in use by placing all the occasions of use on one line per location.&lt;/P&gt;&lt;P&gt;This is what i have at the moment:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Utilisation.jpeg" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/21903iBDF0A02C3ACC235A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Utilisation.jpeg" alt="Utilisation.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Expression i have used is:&amp;nbsp;FirstSortedValue(DISTINCT [Length of Time in Theatres],1,1) and then&amp;nbsp;FirstSortedValue(DISTINCT Into_theatre_Time,1,1) as the bar offset definition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas how to go about adding the other instances of area usage?&lt;/P&gt;&lt;P&gt;(for completeness the chart is a stacked bar chart rotated on its side).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637267#M732421</guid>
      <dc:creator>peterderrington</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: expression for second sorted value</title>
      <link>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637281#M732422</link>
      <description>&lt;P&gt;With the third parameter you could define which n-th value should be returned:&lt;/P&gt;&lt;P&gt;FirstSortedValue(DISTINCT [Length of Time in Theatres],1,&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;n&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 15:06:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637281#M732422</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-10-18T15:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: expression for second sorted value</title>
      <link>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637283#M732423</link>
      <description>&lt;P&gt;To see if i could work out some of the expressions i've been playing about with a straight table and i can manage to display the time of the second usage (and third etc) with this:&lt;/P&gt;&lt;P&gt;FirstSortedValue(Into_theatre_Time,Into_theatre_Time,2)&lt;/P&gt;&lt;P&gt;However i can't manage to fit that into the bar chart.&lt;/P&gt;&lt;P&gt;I used the expression of&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirstSortedValue([Length of Time in Theatres],[Length of Time in Theatres],2)&lt;/P&gt;&lt;P&gt;and then used the Bar Offset of&lt;/P&gt;&lt;P&gt;FirstSortedValue(Into_theatre_Time,Into_theatre_Time,2)&lt;/P&gt;&lt;P&gt;but it put the usage miles away from where it should be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Utilisation 2.jpeg" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/21906i203557D819C944ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Utilisation 2.jpeg" alt="Utilisation 2.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 15:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637283#M732423</guid>
      <dc:creator>peterderrington</dc:creator>
      <dc:date>2019-10-18T15:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: expression for second sorted value</title>
      <link>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637292#M732424</link>
      <description>&lt;P&gt;Ok,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clearly very very close now.&lt;/P&gt;&lt;P&gt;Using the bar offset of&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirstSortedValue(Into_theatre_Time,1,2)&lt;/P&gt;&lt;P&gt;and then changing that last 2 to a 3 and so on allows the bars to show but the gap between the sections isnt correct.&lt;/P&gt;&lt;P&gt;It look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Utilisation 3.jpeg" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/21907iC51A8B72D45A77B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Utilisation 3.jpeg" alt="Utilisation 3.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now there should be some gaps between those sections (as the location can't be used continually) and certainly the Into_theatre_Time for the second (and subsequent) occasion is after the end of the previous [Length of Time in Theatres] time code.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 15:38:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637292#M732424</guid>
      <dc:creator>peterderrington</dc:creator>
      <dc:date>2019-10-18T15:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: expression for second sorted value</title>
      <link>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637298#M732425</link>
      <description>&lt;P&gt;The more i dig the worse it gets.&lt;/P&gt;&lt;P&gt;i've filtered down to just one location on one date to make it easier to troubleshoot.&lt;/P&gt;&lt;P&gt;There are 4 people in the location that day.&lt;/P&gt;&lt;P&gt;P1 - 08:31 in - 10:49 out - Length of time: 2h 18m&lt;/P&gt;&lt;P&gt;P2 - 10:56 in - 13:20 out - Length of time: 2h 24m&lt;/P&gt;&lt;P&gt;P3 - 13:53 in - 15:35 out - Length of time: 1h 42m&lt;/P&gt;&lt;P&gt;P4 - 15:45 in - 16:39 out - Length of time: 54m&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However if i hover over the graph it shows for length of time:&lt;/P&gt;&lt;P&gt;P1 - 2h 18m&lt;/P&gt;&lt;P&gt;P2 - 1h 42m&lt;/P&gt;&lt;P&gt;P3 - 2h 18m&lt;/P&gt;&lt;P&gt;P4 - 2h 24m&lt;/P&gt;&lt;P&gt;So not only is it not returning the correct Length of time its then also not displaying the offset correctly.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 15:57:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637298#M732425</guid>
      <dc:creator>peterderrington</dc:creator>
      <dc:date>2019-10-18T15:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: expression for second sorted value</title>
      <link>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637694#M732426</link>
      <description>&lt;P&gt;If it's worked within a table but not within a chart it might be caused from the applied dimensions - means that the table is more granular as the chart. In this case you may need to apply an aggr-wrapping for your expression in the chart.&lt;/P&gt;&lt;P&gt;Further your approach looked a bit like a gantt chart and therefore the following might be useful in any way:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Recipe-for-a-Gantt-chart/ba-p/1469842" target="_self"&gt;Recipe-for-a-Gantt-chart&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/Files-for-creation-of-a-Gantt-chart/ta-p/1487079" target="_self"&gt;Files-for-creation-of-a-Gantt-chart&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 10:00:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637694#M732426</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-10-21T10:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: expression for second sorted value</title>
      <link>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637717#M732427</link>
      <description>&lt;P&gt;It hasn't though. That's the problem.&lt;/P&gt;&lt;P&gt;Trying to identify the correct order is the first problem, then I can work out how to do the offset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will have a look at the Gantt chart stuff but I think I've looked at that before and I wasn't able to recreate it, this is the closest I've got before.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 10:28:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-for-second-sorted-value/m-p/1637717#M732427</guid>
      <dc:creator>peterderrington</dc:creator>
      <dc:date>2019-10-21T10:28:49Z</dc:date>
    </item>
  </channel>
</rss>

