<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38660#M6513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=NUM(SUM({$&amp;lt;CommonMonth={$(=max(CommonMonth))}, CommonMonth= &amp;gt;} RetainedAccounts)/Sum({&amp;lt;CommonMonth = {"$(=date(AddYears(Date&lt;SPAN style="text-decoration: underline;"&gt;(DATE#(MAX({1}CommonMonth,'YYYY/MM')))&lt;/SPAN&gt;,-1),'YYYY/MM'))"}&amp;gt;} NumAccts),'#0%')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get '-' when I do your last suggestion... above is what I did. I need DATE# to convert to string&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Feb 2018 18:53:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-02T18:53:38Z</dc:date>
    <item>
      <title>Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38651#M6504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=NUM(SUM({$&amp;lt;CommonMonth={$(=max(CommonMonth))}, CommonMonth= &amp;gt;} RetainedAccounts)/&lt;STRONG style="color: #ff0000;"&gt;Sum({&amp;lt;CommonMonth = {"$(=date(AddYears(Date(DATE#(CommonMonth,'YYYY/MM')),-1),'YYYY/MM'))"}&amp;gt;} NumAccts),'#0%')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first half calculates correctly, it finds the maximum month in my dataset and sums the retained accounts. The second part I want to do the same thing but look 1 year back (Current month but the previous year). I have tried to insert the MAX function into the second part of the statement (red text) with no luck. My aim is to have a static value no matter what date you select as it will always show the MAX date from my dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 17:16:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38651#M6504</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-01T17:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38652#M6505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If CommonMonth is not a dimension in the chart, you can try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Num(Sum({$&amp;lt;CommonMonth={$(=max(CommonMonth))}&amp;gt;} RetainedAccounts)/Sum(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;CommonMonth = {"$(=Date(AddYears(Max(CommonMonth), -1), 'YYYY/MM'))"}&lt;/SPAN&gt;&amp;gt;} NumAccts),'#0%')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 17:35:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38652#M6505</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-01T17:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38653#M6506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For making this static, you can try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Num(Sum({$&amp;lt;CommonMonth = {$(=Max(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;CommonMonth&amp;gt;}&lt;/SPAN&gt;CommonMonth))}&amp;gt;} RetainedAccounts)/Sum({&amp;lt;CommonMonth = {"$(=Date(AddYears(Max(&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;{&amp;lt;CommonMonth&amp;gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;CommonMonth), -1), 'YYYY/MM'))"}&amp;gt;} NumAccts),'#0%')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Num(Sum({$&amp;lt;CommonMonth = {$(=Max(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;{1}&lt;/SPAN&gt;CommonMonth))}&amp;gt;} RetainedAccounts)/Sum({&amp;lt;CommonMonth = {"$(=Date(AddYears(Max(&lt;STRONG style="font-style: inherit; font-family: inherit; color: #ff0000;"&gt;{1}&lt;/STRONG&gt;CommonMonth), -1), 'YYYY/MM'))"}&amp;gt;} NumAccts),'#0%')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 17:36:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38653#M6506</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-01T17:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38654#M6507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - I still need to convert the data from YYYY/MM format into normal date,subtract a year, then convert it back to YYYY/MM which is in my original formula, how would I apply the MAX in that case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 10:40:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38654#M6507</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-02T10:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38655#M6508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure I follow... would you be able to share a sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 16:52:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38655#M6508</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-02T16:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38656#M6509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=NUM(SUM({$&amp;lt;CommonMonth={$(=max(CommonMonth))}, CommonMonth= &amp;gt;} RetainedAccounts)/&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;Sum({&amp;lt;CommonMonth = {"$(=date(AddYears(Date(DATE#(CommonMonth,'YYYY/MM')),-1),'YYYY/MM'))"}&amp;gt;} NumAccts),'#0%')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The bit in red, this works, but I just need to add the MAX bit in, just not sure where. I need to keep the DATE# part as my COMMONMONTH is in this format YYYY/MM, so when DATE tries to subtract a year, it doesn't understand the format, so I need to keep that bit in, but in your answer the DATE# part was removed, so if I keep the formula the same, but just add MAX, where would I put it? As I tried your formulas and they do not work for me for this reason. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 17:01:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38656#M6509</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-02T17:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38657#M6510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't think I understand... may be someone else can help you better &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 18:18:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38657#M6510</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-02T18:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38658#M6511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the second bit of my formula (red bit) I need to look at the maximum month for example would now be 2018/02 and then select the date one year previous so 2017/02. No matter what date selection a user picks on the CommonMonth selection, it should always show the calculation as the Maximum month in the dataset one year back. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 18:28:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38658#M6511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-02T18:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38659#M6512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Num(Sum({$&amp;lt;CommonMonth = {$(=Max(CommonMonth))}&amp;gt;} RetainedAccounts)/Sum({&amp;lt;CommonMonth = {"$(=Date(AddYears(Max(&lt;STRONG style="font-style: inherit; font-family: inherit; color: #ff0000;"&gt;{1}&lt;/STRONG&gt;CommonMonth), -1), 'YYYY/MM'))"}&amp;gt;} NumAccts),'#0%')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 18:31:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38659#M6512</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-02T18:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38660#M6513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=NUM(SUM({$&amp;lt;CommonMonth={$(=max(CommonMonth))}, CommonMonth= &amp;gt;} RetainedAccounts)/Sum({&amp;lt;CommonMonth = {"$(=date(AddYears(Date&lt;SPAN style="text-decoration: underline;"&gt;(DATE#(MAX({1}CommonMonth,'YYYY/MM')))&lt;/SPAN&gt;,-1),'YYYY/MM'))"}&amp;gt;} NumAccts),'#0%')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get '-' when I do your last suggestion... above is what I did. I need DATE# to convert to string&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 18:53:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38660#M6513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-02T18:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38661#M6514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you need to do that? If your top expression is working with Max(CommonMonth), it means that your date is read correctly as a date...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" src="https://community.qlik.com/legacyfs/online/192386_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But anyways, try this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Num(Sum({$&amp;lt;CommonMonth={$(=max(CommonMonth))}, CommonMonth= &amp;gt;} RetainedAccounts)/Sum({&amp;lt;CommonMonth = {"$(=Date(AddYears(Date(Date#(Max({1}CommonMonth),'YYYY/MM')), -1), 'YYYY/MM'))"}&amp;gt;} NumAccts),'#0%')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 19:02:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38661#M6514</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-02T19:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38662#M6515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because I am trying to look 1 year back, I understood previously that I would have to convert my string YYYY/MM into a date, go back one year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still get a '-' when I use the revised formula.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 19:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38662#M6515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-02T19:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38663#M6516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unless I see... I won't know.... Sorry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 19:07:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38663#M6516</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-02T19:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Max month</title>
      <link>https://community.qlik.com/t5/QlikView/Max-month/m-p/38664#M6517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some threads for look at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3102"&gt;QlikView Date fields&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2622"&gt;Get the Dates Right&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2954"&gt;Why don’t my dates work?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4394"&gt;Dates in Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2018 19:09:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-month/m-p/38664#M6517</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-02T19:09:49Z</dc:date>
    </item>
  </channel>
</rss>

