<?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: How to get second to last value? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862326#M989839</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ioannis,&lt;/P&gt;&lt;P&gt;Thanks for your reply. Yes, these are actual dates - I just used months here to simplify my example.&lt;/P&gt;&lt;P&gt;Unfortunately if you use max(MyDate)-1, you always get the penultimate date, regardless if it is within current selections or not. I need the penultimate date to be within the current selections. In my second example the user has selected Nov, Sep, Aug, and the penultimate month should be Sep (and if I do -1, as you suggested, I get Oct).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jul 2015 14:12:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-07-13T14:12:47Z</dc:date>
    <item>
      <title>How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862321#M989834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to make comparisons between KPIs on the "Last Date" vs. the "Penultimate Date" &lt;SPAN style="text-decoration: underline;"&gt;of the dates the users selected&lt;/SPAN&gt;. I have 2 variables to store these dates (vLastDate, vPenultimateDate).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example the following dates are available in the dataset. The ones marked with asterisks are the ones the user has selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dec&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;** Nov **&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;** Oct **&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;** Sep **&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Aug&lt;/P&gt;&lt;P&gt;-----&amp;gt; vLastDate should be &lt;STRONG&gt;Nov&lt;/STRONG&gt;, vPenultimateDate should be &lt;STRONG&gt;Oct&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Dec&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;** Nov **&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Oct&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;** Sep **&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;** Aug **&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;-----&amp;gt; vLastDate should be &lt;STRONG&gt;Nov&lt;/STRONG&gt;, vPenultimateDate should be &lt;STRONG&gt;Sep&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P&gt;To get the last date I just use max(MyDate). But how can I get the previous date selected?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Mara.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 13:59:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862321#M989834</guid>
      <dc:creator />
      <dc:date>2015-07-13T13:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862322#M989835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using these varables in expressions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 14:01:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862322#M989835</guid>
      <dc:creator>Michiel_QV_Fan</dc:creator>
      <dc:date>2015-07-13T14:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862323#M989836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do you have a month number associated to month? If yes, you could just reference it as Max(MyDateID) - 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 14:01:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862323#M989836</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2015-07-13T14:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862324#M989837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I understand completely, but try this may be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max(MyDate, 2)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 14:02:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862324#M989837</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-13T14:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862325#M989838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michiel, thanks for you reply. Yes I am using the variables in expressions, using set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 14:09:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862325#M989838</guid>
      <dc:creator />
      <dc:date>2015-07-13T14:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862326#M989839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ioannis,&lt;/P&gt;&lt;P&gt;Thanks for your reply. Yes, these are actual dates - I just used months here to simplify my example.&lt;/P&gt;&lt;P&gt;Unfortunately if you use max(MyDate)-1, you always get the penultimate date, regardless if it is within current selections or not. I need the penultimate date to be within the current selections. In my second example the user has selected Nov, Sep, Aug, and the penultimate month should be Sep (and if I do -1, as you suggested, I get Oct).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 14:12:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862326#M989839</guid>
      <dc:creator />
      <dc:date>2015-07-13T14:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862327#M989840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, so simple. Thanks sunindia!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 14:14:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862327#M989840</guid>
      <dc:creator />
      <dc:date>2015-07-13T14:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862328#M989841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad I was able to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 14:15:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/862328#M989841</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-07-13T14:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/1662570#M989842</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class="login-bold"&gt;Sunny_talwar,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have tried this and it works wonderfully. The only problem I am encountering is for data set with duplicate values it ignores the duplicate. Say I have a data set called "Data" with the following: 2, 2, 2, 3, 3 and 8. If I do Max(Data, 4) if gives me 2, but if I do Max(Data, 5) it gives me nothing. What I want is for when I do Max(Data, 5) for it to give me 2, Max(Data,6) = 2 and so on. Please help.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 19:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/1662570#M989842</guid>
      <dc:creator>jorgett</dc:creator>
      <dc:date>2020-01-03T19:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get second to last value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/1897698#M1217619</link>
      <description>&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 15:11:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-second-to-last-value/m-p/1897698#M1217619</guid>
      <dc:creator>marina24</dc:creator>
      <dc:date>2022-02-25T15:11:12Z</dc:date>
    </item>
  </channel>
</rss>

