<?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 How to get the last value from a field without having selection on it in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-the-last-value-from-a-field-without-having-selection/m-p/1240632#M863673</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;I have a field named 'item' which is having data from 1 to 1001. i want to create two variable which will give me 1001 and 1000 as the output(last two values from item). currently I am using the expressions SubField(concat(aggr(only({&amp;lt;item=p(item)&amp;gt;}item),item),'|'),'|',-1)&lt;/P&gt;&lt;P&gt;and &lt;SPAN style="font-size: 13.3333px;"&gt;SubField(concat(aggr(only({&amp;lt;item=p(item)&amp;gt;}item),item),'|'),'|',-2) as the two variable expressions. I am supposed to get the answers 1000 and 1001. but I am getting 999 and 998.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also the output of the variable should get changed based on the selection of values inside item. in that case I am not able to create this variables in script level using peek function.So I am creating two variables in front end only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attached is the sample report and source file.hope the question is clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>How to get the last value from a field without having selection on it</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-last-value-from-a-field-without-having-selection/m-p/1240632#M863673</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;I have a field named 'item' which is having data from 1 to 1001. i want to create two variable which will give me 1001 and 1000 as the output(last two values from item). currently I am using the expressions SubField(concat(aggr(only({&amp;lt;item=p(item)&amp;gt;}item),item),'|'),'|',-1)&lt;/P&gt;&lt;P&gt;and &lt;SPAN style="font-size: 13.3333px;"&gt;SubField(concat(aggr(only({&amp;lt;item=p(item)&amp;gt;}item),item),'|'),'|',-2) as the two variable expressions. I am supposed to get the answers 1000 and 1001. but I am getting 999 and 998.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also the output of the variable should get changed based on the selection of values inside item. in that case I am not able to create this variables in script level using peek function.So I am creating two variables in front end only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attached is the sample report and source file.hope the question is clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-last-value-from-a-field-without-having-selection/m-p/1240632#M863673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last value from a field without having selection on it</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-last-value-from-a-field-without-having-selection/m-p/1240633#M863674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not using&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;=Max(item,1)&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;resp.&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;=Max(item,2)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2016 12:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-last-value-from-a-field-without-having-selection/m-p/1240633#M863674</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-12-27T12:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last value from a field without having selection on it</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-last-value-from-a-field-without-having-selection/m-p/1240634#M863675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your sample, item seems to be from 1 till 1171&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/147721_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if the goal is find the max value of item and second highest value of item, why not just use Max() function here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max(item)&lt;/STRONG&gt; -&amp;gt; for max value&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max(item, 2)&lt;/STRONG&gt; -&amp;gt; for 2nd highest value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2016 12:22:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-last-value-from-a-field-without-having-selection/m-p/1240634#M863675</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-27T12:22:16Z</dc:date>
    </item>
  </channel>
</rss>

