<?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: Max Month minus 1 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/2496281#M1226289</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I know this is an old thread (well, this thread is the first on Google&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;), but I had a kinda-similar problem, when I had to lookup the value before highest value.&lt;/P&gt;
&lt;P&gt;If you use&lt;/P&gt;
&lt;PRE&gt;max([Field]) &lt;/PRE&gt;
&lt;P&gt;you obviously get highest value of [Field]. With this value, you can do simple maths, like max()-1 or "add" -1 day, month ... to a date. But if the value before the highest is not guessable, you can use the second parameter of max() function :&lt;/P&gt;
&lt;PRE&gt;max([Field], 2)&lt;/PRE&gt;
&lt;P&gt;This will return the value before the highest,&amp;nbsp;&lt;SPAN&gt;in both Qlikview and Qliksense. A similar parameter also exists for min().&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/ChartFunctions/BasicAggregationFunctions/max.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/ChartFunctions/BasicAggregationFunctions/max.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case, this should do the trick :&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Count({&amp;lt;ADMIT_MNTH = {"$(=&lt;STRONG&gt;Max(ADMIT_MNTH, 2)&lt;/STRONG&gt;)"}&amp;gt;}[Patient])&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2024 15:15:02 GMT</pubDate>
    <dc:creator>Ke_Sg</dc:creator>
    <dc:date>2024-12-05T15:15:02Z</dc:date>
    <item>
      <title>Max Month minus 1</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734532#M722464</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the expression -&amp;nbsp;Count({&amp;lt;ADMIT_MNTH = {"$(=Max(ADMIT_MNTH))"}&amp;gt;}[Patient]) which gives me the max month but i know need the same expression but the previous month so MINUS 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kev&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734532#M722464</guid>
      <dc:creator>kev6brown</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Max Month minus 1</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734534#M722465</link>
      <description>&lt;P&gt;&lt;SPAN&gt;use addmonths function with -1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;ADMIT_MNTH = {"$(=AddMonths(Max(ADMIT_MNTH),-1))"}&amp;gt;}[Patient])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 14:25:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734534#M722465</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2020-08-10T14:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Max Month minus 1</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734537#M722466</link>
      <description>Comes through as zeros&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Aug 2020 14:31:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734537#M722466</guid>
      <dc:creator>kev6brown</dc:creator>
      <dc:date>2020-08-10T14:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Max Month minus 1</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734544#M722467</link>
      <description>&lt;P&gt;check output of this expression in a text object and check&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;AddMonths(Max(ADMIT_MNTH),-1)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 14:41:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734544#M722467</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2020-08-10T14:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Max Month minus 1</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734545#M722468</link>
      <description>&lt;P&gt;try below&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;assuming&amp;nbsp;ADMIT_MNTH format is &lt;STRONG&gt;MMM YYYY.&amp;nbsp;&lt;/STRONG&gt; In below set you can try giving actual format&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;ADMIT_MNTH = {"$(=&lt;STRONG&gt;date&lt;/STRONG&gt;(addmonths(Max(ADMIT_MNTH),-1),&lt;STRONG&gt;'MMM YYYY')&lt;/STRONG&gt;)"}&amp;gt;}[Patient])&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 14:42:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734545#M722468</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-08-10T14:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Max Month minus 1</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734547#M722469</link>
      <description>That gives me the previous month but in the format 01/06/2020 maybe that's why&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Aug 2020 14:45:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734547#M722469</guid>
      <dc:creator>kev6brown</dc:creator>
      <dc:date>2020-08-10T14:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Max Month minus 1</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734549#M722470</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/8220"&gt;@kev6brown&lt;/a&gt;&amp;nbsp;wrap it with date and try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 14:50:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/1734549#M722470</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2020-08-10T14:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Max Month minus 1</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/2496281#M1226289</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I know this is an old thread (well, this thread is the first on Google&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;), but I had a kinda-similar problem, when I had to lookup the value before highest value.&lt;/P&gt;
&lt;P&gt;If you use&lt;/P&gt;
&lt;PRE&gt;max([Field]) &lt;/PRE&gt;
&lt;P&gt;you obviously get highest value of [Field]. With this value, you can do simple maths, like max()-1 or "add" -1 day, month ... to a date. But if the value before the highest is not guessable, you can use the second parameter of max() function :&lt;/P&gt;
&lt;PRE&gt;max([Field], 2)&lt;/PRE&gt;
&lt;P&gt;This will return the value before the highest,&amp;nbsp;&lt;SPAN&gt;in both Qlikview and Qliksense. A similar parameter also exists for min().&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/ChartFunctions/BasicAggregationFunctions/max.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/qlikview/May2024/Subsystems/Client/Content/QV_QlikView/ChartFunctions/BasicAggregationFunctions/max.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case, this should do the trick :&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Count({&amp;lt;ADMIT_MNTH = {"$(=&lt;STRONG&gt;Max(ADMIT_MNTH, 2)&lt;/STRONG&gt;)"}&amp;gt;}[Patient])&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 15:15:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Month-minus-1/m-p/2496281#M1226289</guid>
      <dc:creator>Ke_Sg</dc:creator>
      <dc:date>2024-12-05T15:15:02Z</dc:date>
    </item>
  </channel>
</rss>

