<?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: Set Analysis Qtr, max(Month) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50199#M8279</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;I added a sample application... which is working as you've described. I'll go back to my actual app and compare and see what's different and if I can fix it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jun 2018 19:50:50 GMT</pubDate>
    <dc:creator>ttollin11</dc:creator>
    <dc:date>2018-06-19T19:50:50Z</dc:date>
    <item>
      <title>Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50193#M8273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to build an expression that shows the sum of the balances for the previous quarter's max month. Here's the variables and function I have:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_152941838527942" jivemacro_uid="_152941838527942"&gt;
&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco; font-size: 10pt;"&gt;previousQuarter = 'Q' &amp;amp; (Right(Quarter, 1) - 1)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: terminal, monaco;"&gt;maxMonthSelected =max([Deposit Month])&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: terminal, monaco;"&gt;=sum ( {&amp;lt; Quarter = {$(=previousQuarter)}, [Deposit Month] = {$(=maxMonthSelected)} &amp;gt;} [Current Balance Amount] )&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is returning 0, which isn't correct. The variables themselves are returning what I expect except if Quarter = Q1, which I'll have to fix later. Am I missing something in my set expression? I've tried swapping the variables for the expressions of the variables and the syntax checker doesn't accept it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Added (working...?) sample at Sunny's request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Tyler Tollin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 14:27:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50193#M8273</guid>
      <dc:creator>ttollin11</dc:creator>
      <dc:date>2018-06-19T14:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50194#M8274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;previousQuarter = 'Q' &amp;amp; (Right(Quarter, 1) - 1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;maxMonthSelected = Max(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;Quarter = {$(=previousQuarter)}&amp;gt;}&lt;/SPAN&gt; [Deposit Month])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;Quarter = {$(=previousQuarter)}, [Deposit Month] = {$(=maxMonthSelected)}&amp;gt;} [Current Balance Amount] )&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 16:59:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50194#M8274</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-19T16:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50195#M8275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for helping, Sunny.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've either done something wrong, or it isn't working. I created a new variable:&lt;/P&gt;&lt;P&gt;maxMonthPrevQtr =Max( {&amp;lt;Quarter = {$(=previousQuarter)}&amp;gt;} [Deposit Month])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and inserted it into the original function:&lt;/P&gt;&lt;P&gt;=sum ( {&amp;lt; Quarter = {$(=previousQuarter)}, [Deposit Month] = {$(=maxMonthPrevQtr)} &amp;gt;} [Current Balance Amount] )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is still returning 0. The new variable, if put into a textbox alone, works as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 17:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50195#M8275</guid>
      <dc:creator>ttollin11</dc:creator>
      <dc:date>2018-06-19T17:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50196#M8276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, this shows you the right Month to display?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Max({&amp;lt;Quarter = {$(=previousQuarter)}&amp;gt;} [Deposit Month])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May you you need Single/Double quotes within dollar sign expansion&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;Quarter = {&lt;STRONG style=": ; color: #ff0000; font-size: 12pt;"&gt;"&lt;/STRONG&gt;$(=previousQuarter)&lt;STRONG style=": ; color: #ff0000; font-size: 12pt;"&gt;"&lt;/STRONG&gt;}, [Deposit Month] = {&lt;SPAN style="color: #ff0000; font-size: 12pt;"&gt;"&lt;/SPAN&gt;$(=maxMonthPrevQtr)&lt;STRONG style=": ; color: #ff0000; font-size: 12pt;"&gt;"&lt;/STRONG&gt;}&amp;gt;} [Current Balance Amount])&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 17:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50196#M8276</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-19T17:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50197#M8277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That variable does work as intended, yes. IE: selecting Q2 2017 returns month = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried both single and double quotes, no luck. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 17:27:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50197#M8277</guid>
      <dc:creator>ttollin11</dc:creator>
      <dc:date>2018-06-19T17:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50198#M8278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample to test this out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 17:31:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50198#M8278</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-19T17:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50199#M8279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;I added a sample application... which is working as you've described. I'll go back to my actual app and compare and see what's different and if I can fix it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 19:50:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50199#M8279</guid>
      <dc:creator>ttollin11</dc:creator>
      <dc:date>2018-06-19T19:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50200#M8280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds good &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, 19 Jun 2018 19:55:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50200#M8280</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-19T19:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qtr, max(Month)</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50201#M8281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to get this working by putting my month and year fields in Num(). I'm still working on the =if() for when Quarter = Q1 and I need Q4 of previous year data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Going to mark this as closed; thanks for you help as always, Sunny!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2018 12:30:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qtr-max-Month/m-p/50201#M8281</guid>
      <dc:creator>ttollin11</dc:creator>
      <dc:date>2018-06-21T12:30:45Z</dc:date>
    </item>
  </channel>
</rss>

