<?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 Second MaxString in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284744#M26882</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 am new to Qlik Sense and would be very grateful if someone could help me out with this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field called Quarter which has the following values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FY1516-Quarter 2&lt;/P&gt;&lt;P&gt;FY1516-Quarter 3&lt;/P&gt;&lt;P&gt;FY1516-Quarter 4&lt;/P&gt;&lt;P&gt;FY1617-Quarter 1&lt;/P&gt;&lt;P&gt;FY1617-Quarter 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find the sum of another field called value for the highest quarter and the second highest quarter selected i.e. if the last 3 are selected in the above list, I should get the sum of values for FY1617-Quarter 2 and FY1617- Quarter 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got the value for FY1617-Quarter 2 with the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Quarter={"$(=MaxString(Quarter))"}&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am not sure how to obtain the value for FY1617-Quarter 1. Can someone please help me out?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2017 22:22:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-02-15T22:22:32Z</dc:date>
    <item>
      <title>Second MaxString</title>
      <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284744#M26882</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 am new to Qlik Sense and would be very grateful if someone could help me out with this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field called Quarter which has the following values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FY1516-Quarter 2&lt;/P&gt;&lt;P&gt;FY1516-Quarter 3&lt;/P&gt;&lt;P&gt;FY1516-Quarter 4&lt;/P&gt;&lt;P&gt;FY1617-Quarter 1&lt;/P&gt;&lt;P&gt;FY1617-Quarter 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find the sum of another field called value for the highest quarter and the second highest quarter selected i.e. if the last 3 are selected in the above list, I should get the sum of values for FY1617-Quarter 2 and FY1617- Quarter 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got the value for FY1617-Quarter 2 with the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Quarter={"$(=MaxString(Quarter))"}&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am not sure how to obtain the value for FY1617-Quarter 1. Can someone please help me out?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2017 22:22:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284744#M26882</guid>
      <dc:creator />
      <dc:date>2017-02-15T22:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Second MaxString</title>
      <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284745#M26883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would recommend to create a new field in the script to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Quarter,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KeepChar(Quarter, '0123456789') as QuarterNum&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM ....;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then these:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Highest Quarter&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;STRONG&gt;Sum({$&amp;lt;QuarterNum={"$(=Max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;QuarterNum&lt;/SPAN&gt;))"}, Quarter&amp;gt;}Value)&lt;/STRONG&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;&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;Second Highest Quarter&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&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;&lt;STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({$&amp;lt;QuarterNum={"$(=Max(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;QuarterNum, 2&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;))"}, Quarter&amp;gt;}Value)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 09:27:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284745#M26883</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-16T09:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Second MaxString</title>
      <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284746#M26884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On the front end, you can try this for 2nd highest&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;&lt;STRONG&gt;Sum({$&amp;lt;Quarter = {"&lt;SPAN style="color: #ff0000;"&gt;=KeepChar(Quarter, '0123456789') = Max(TOTAL KeepChar(Quarter, '0123456789'), 2)&lt;/SPAN&gt;"}&amp;gt;}Value)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 09:28:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284746#M26884</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-16T09:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Second MaxString</title>
      <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284747#M26885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Thanks for this. However, I believe I am at a much lower level with respect to Qlik Sense to comprehend correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me where I should add the new field - is it in the data load editor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2017 06:29:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284747#M26885</guid>
      <dc:creator />
      <dc:date>2017-02-23T06:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Second MaxString</title>
      <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284748#M26886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will get you the maxstring quarter minus one. It would be better to put this in a variable then use in expression;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Left(Maxstring(Qtr),15) &amp;amp; num(Right(Maxstring(Qtr),1)-1) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Expression;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Quarter={"$(=Left(Maxstring(Quarter),15) &amp;amp; num(Right(Maxstring(Quarter),1)-1))"}&amp;gt;}Value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2017 10:03:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284748#M26886</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T10:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Second MaxString</title>
      <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284749#M26887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that's where I intend you to create a new field&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2017 10:06:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284749#M26887</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-23T10:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Second MaxString</title>
      <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284750#M26888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome - this works perfect!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2017 02:18:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284750#M26888</guid>
      <dc:creator />
      <dc:date>2017-02-28T02:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Second MaxString</title>
      <link>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284751#M26889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gareth - this isn't working in certain situations as if I have a bunch of years, when I select only the first quarter of a year, the expression calculates the value as 0 instead of going back go 4th quarter of the previous year. Sunny's solution above worked well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help though! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2017 02:22:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Second-MaxString/m-p/1284751#M26889</guid>
      <dc:creator />
      <dc:date>2017-02-28T02:22:33Z</dc:date>
    </item>
  </channel>
</rss>

