<?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: Alternative for Using MonthEnd in If Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Alternative-for-Using-MonthEnd-in-If-Statement/m-p/921524#M529024</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe that the solution provided by &lt;A _jive_internal="true" href="https://community.qlik.com/people/yura_ratu"&gt;Yurii&lt;/A&gt;‌ is certainly doing what you wanted. Here I did a comparison of what my expression was doing and what his is doing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/96038_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression with 2 is what Yurii offered (and 1 was what I initially provided). Here we see that for the year where Actual is available you only see amount accumulated for actual amount and starting next period the accumulation start to happen on forecast data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My only concern here would be the use of 1 in the expression (which is forcing it to not change based on selections (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Monthend(Max({1&amp;lt;ACT_AMT={"&amp;gt;0"}&amp;gt;}TRX_DATE))&lt;/STRONG&gt;). I would try to make some selections and see if the results are what you thought you wanted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression without 1 also seems to give the same result without selections, but with selections it may differ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Sum(ACT_AMT) &amp;gt; 0 or Sum(FCST_AMT) &amp;gt; 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RangeSum(Above(TOTAL If(FISCAL_MONTH_YEAR &amp;lt;= Monthend(Max({&amp;lt;ACT_AMT={"&amp;gt;0"}&amp;gt;}TRX_DATE)), Sum(ACT_AMT), Sum(FCST_AMT)), 0, RowNo())))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need a hybrid of the two expressions where you want it to be changed based on certain selections and not changed on others, you may be able to modify the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will 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>Fri, 14 Aug 2015 01:42:09 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-08-14T01:42:09Z</dc:date>
    <item>
      <title>Alternative for Using MonthEnd in If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-Using-MonthEnd-in-If-Statement/m-p/921522#M529022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an urgent need to get this fixed ASAP so help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awhile back, I posted &lt;A _jive_internal="true" href="https://community.qlik.com/message/831371?et=watches.email.thread#831371" title="https://community.qlik.com/message/831371?et=watches.email.thread#831371"&gt;https://community.qlik.com/message/831371?et=watches.email.thread#831371&lt;/A&gt; and received some great info from on how to Use MonthEnd in If Statement. Unfortunately, I have discovered an issue with using this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression (With no accumulation)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Sum(ACT_AMT) &amp;gt; 0 or Sum(FCST_AMT) &amp;gt; 0, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RangeSum(Above(TOTAL If(FISCAL_MONTH_YEAR &amp;lt;= Monthend(Today()), Sum(ACT_AMT), Sum(FCST_AMT)), 0, RowNo())))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I look at the graph today, I don't see any x-axis date for July 2015. I &lt;SPAN style="text-decoration: underline;"&gt;assume&lt;/SPAN&gt; that this because the expression is using today's date instead of looking at the data to see when the most recent TRX_DATE for ACT_AMT is. Our ACT_AMT takes a couple of weeks to post so it is not unusual for it to be 8/12/15 but not yet have data for July 2015.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The intent of the graph is to show ACT_AMT for historical information and FCST_AMT for future information... but this needs to be based on the date of ACT_AMT in the data as opposed to the current date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I cannot get the sample app to replicate the issue that I am seeing in my actual dashboard so my assumption of the issue might not be correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Live Dashboard:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="8-12-2015 9-35-40 AM.gif" class="jive-image image-1" src="/legacyfs/online/95803_8-12-2015 9-35-40 AM.gif" style="width: 620px; height: 231px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all you wonderful people!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 16:51:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-Using-MonthEnd-in-If-Statement/m-p/921522#M529022</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2015-08-12T16:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for Using MonthEnd in If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-Using-MonthEnd-in-If-Statement/m-p/921523#M529023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Hi Cassandra,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Please try this expression&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;If(Sum(ACT_AMT) &amp;gt; 0 or Sum(FCST_AMT) &amp;gt; 0, &lt;/P&gt;
&lt;P&gt;RangeSum(Above(TOTAL If(FISCAL_MONTH_YEAR &amp;lt;= Monthend(Max({1&amp;lt;ACT_AMT={"&amp;gt;0"}&amp;gt;}TRX_DATE)), Sum(ACT_AMT), Sum(FCST_AMT)), 0, RowNo())))&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 13:52:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-Using-MonthEnd-in-If-Statement/m-p/921523#M529023</guid>
      <dc:creator>yura_ratu</dc:creator>
      <dc:date>2015-08-13T13:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for Using MonthEnd in If Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Alternative-for-Using-MonthEnd-in-If-Statement/m-p/921524#M529024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe that the solution provided by &lt;A _jive_internal="true" href="https://community.qlik.com/people/yura_ratu"&gt;Yurii&lt;/A&gt;‌ is certainly doing what you wanted. Here I did a comparison of what my expression was doing and what his is doing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/96038_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression with 2 is what Yurii offered (and 1 was what I initially provided). Here we see that for the year where Actual is available you only see amount accumulated for actual amount and starting next period the accumulation start to happen on forecast data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My only concern here would be the use of 1 in the expression (which is forcing it to not change based on selections (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Monthend(Max({1&amp;lt;ACT_AMT={"&amp;gt;0"}&amp;gt;}TRX_DATE))&lt;/STRONG&gt;). I would try to make some selections and see if the results are what you thought you wanted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression without 1 also seems to give the same result without selections, but with selections it may differ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Sum(ACT_AMT) &amp;gt; 0 or Sum(FCST_AMT) &amp;gt; 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RangeSum(Above(TOTAL If(FISCAL_MONTH_YEAR &amp;lt;= Monthend(Max({&amp;lt;ACT_AMT={"&amp;gt;0"}&amp;gt;}TRX_DATE)), Sum(ACT_AMT), Sum(FCST_AMT)), 0, RowNo())))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need a hybrid of the two expressions where you want it to be changed based on certain selections and not changed on others, you may be able to modify the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will 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>Fri, 14 Aug 2015 01:42:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Alternative-for-Using-MonthEnd-in-If-Statement/m-p/921524#M529024</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-14T01:42:09Z</dc:date>
    </item>
  </channel>
</rss>

