<?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: Subtract from AddMonths with variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274274#M871348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siliva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=date(min(addmonths(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Disbursement_MonthYear&lt;/SPAN&gt;,-$(Display2))),'MMM-YYYY')&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;Dispaly2 : =Num(((year(max(Disbursement_MonthYear)) * 12) + month(max(Disbursement_MonthYear))) - (((year(min(Disbursement_MonthYear)) * 12) + month(min(Disbursement_MonthYear)))) + 1)&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;it the above expression it shows expression ok in text box&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;&lt;IMG alt="Capture4.PNG" class="jive-image image-1" height="67" src="https://community.qlik.com/legacyfs/online/144263_Capture4.PNG" style="height: 67px; width: 847.755px;" width="848" /&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;regards&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;Hemanth&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2016 11:43:54 GMT</pubDate>
    <dc:creator>hemanthaanichet</dc:creator>
    <dc:date>2016-11-18T11:43:54Z</dc:date>
    <item>
      <title>Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274267#M871341</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'm working with dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have MonthYear ('MMM-YYYY').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="datas.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/144251_datas.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example I've choose from apr-2016 to jun-2016.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a function MonthDiff that gives me the number of months selected, in this case, 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to get the previous "MonthDiff" months from the date I've selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;If I choose from apr-2016 to jun-2016, so I want previous to be jan-2016 to mar-2016.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if I choose from jan-2016 to jun-2016, I want previous to be jul-2015 to dez-2015.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Going back to my MonthDiff = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do the next expression to get the value jan-2016&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date(min(addmonths(MonthYear,-$(vMonthDiff))), 'MMM-YYYY') &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not working, it's giving me the error "&lt;STRONG&gt;Error: Error in expression: Nested aggregation no allowed&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I solve this problem and achieve what I want?&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Sílvia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274267#M871341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274268#M871342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What does your $(vMonthDiff) expand to ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression itself looks fine, as long as it expands to an integer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 10:54:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274268#M871342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-18T10:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274269#M871343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you created variable there,&amp;nbsp; does the variable&amp;nbsp; gives the 3&amp;nbsp; at this&amp;nbsp; situation.&amp;nbsp; Can you please let me know the value or string you are getting got that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:01:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274269#M871343</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2016-11-18T11:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274270#M871344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siliva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp 1 :SUM({&amp;lt;Year = {$(=only(Year))}, Month = {"&amp;lt;=$(=num(Month))"}&amp;gt;} [Sales Amount])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp 2: SUM({&amp;lt;Year = {$(=only(Year)-1)}, Month = {"&amp;lt;=$(=num(Month))"}&amp;gt;} [Sales Amount])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if select year = 2016 month = nov&lt;/P&gt;&lt;P&gt;exp 1 shows sum of sales from jan to nov individually&lt;/P&gt;&lt;P&gt;exp2 shows previous year sum of sales from jan to nov&amp;nbsp; individually&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have month year as same column &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( monthyear = {"&amp;lt;=$(=(monthyear))"}[sales amount])&lt;/P&gt;&lt;P&gt;sum(&lt;SPAN style="font-size: 13.3333px;"&gt; monthyear = {"&amp;lt;=$(=(monthyear)-1)"}[sales amount])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:01:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274270#M871344</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2016-11-18T11:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274271#M871345</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;This is my MonthDiff Variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Num(((year(max(MonthYear)) * 12) + month(max(MonthYear))) - (((year(min(MonthYear)) * 12) + month(min(MonthYear)))) + 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a separated text object, is giving me the value 3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:06:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274271#M871345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-18T11:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274272#M871346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your variable expression is being expanded to its text content and thus contains aggregation functions such as max which mean you are trying to nest aggregations which is not allowed as the error message says.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try putting an equals sign before the variable to evaluate it to an integer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(min(addmonths(MonthYear,-$(&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/SPAN&gt;vMonthDiff))), 'MMM-YYYY')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; 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: #000000; 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: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Also have a look at this Blog post, &lt;A href="https://community.qlik.com/qlik-blogpost/3996"&gt;The Little Equals Sign&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:23:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274272#M871346</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-18T11:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274273#M871347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried what you've suggested, but is still not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="errordatas.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/144253_errordatas.png" style="height: 387px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:40:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274273#M871347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-18T11:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274274#M871348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siliva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=date(min(addmonths(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Disbursement_MonthYear&lt;/SPAN&gt;,-$(Display2))),'MMM-YYYY')&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;Dispaly2 : =Num(((year(max(Disbursement_MonthYear)) * 12) + month(max(Disbursement_MonthYear))) - (((year(min(Disbursement_MonthYear)) * 12) + month(min(Disbursement_MonthYear)))) + 1)&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;it the above expression it shows expression ok in text box&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;&lt;IMG alt="Capture4.PNG" class="jive-image image-1" height="67" src="https://community.qlik.com/legacyfs/online/144263_Capture4.PNG" style="height: 67px; width: 847.755px;" width="848" /&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;regards&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;Hemanth&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:43:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274274#M871348</guid>
      <dc:creator>hemanthaanichet</dc:creator>
      <dc:date>2016-11-18T11:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274275#M871349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&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;Date(AddMonths(&lt;SPAN style="color: #ff0000;"&gt;Min(&lt;/SPAN&gt;MonthYear&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt;,-$(vMonthDiff)), 'MMM-YYYY')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274275#M871349</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-18T11:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract from AddMonths with variable</title>
      <link>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274276#M871350</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;&lt;/P&gt;&lt;P&gt;Thanks a lot, your suggestion works perfectly &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sílvia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:58:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtract-from-AddMonths-with-variable/m-p/1274276#M871350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-18T11:58:07Z</dc:date>
    </item>
  </channel>
</rss>

