<?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 ADDMONTHS problem? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557371#M482561</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 want to make a table that has a column for every month from last year till now with the turnover in it, so I made:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13756928340881426" jivemacro_uid="_13756928340881426"&gt;&lt;P&gt;Sum ({$&amp;lt;FACTDAT={"&amp;gt;$(=MAKEDATE(YEAR(ADDMONTHS(NOW(2),-11)), MONTH(ADDMONTHS(NOW(2),-11))) &amp;lt;$(=MAKEDATE(YEAR(ADDMONTHS(NOW(2),-10,1)), MONTH(ADDMONTHS(NOW(2),-10,1)))"}&amp;gt;} VERKOOP1)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13756928477992185" jivemacro_uid="_13756928477992185"&gt;&lt;P&gt;Sum ({$&amp;lt;FACTDAT={"&amp;gt;=$(=monthname ( today(), -10 )) &amp;lt;$(=monthname ( today(), -9 ))"}, FIXEDCAR-={"DEL"}&amp;gt;} VERKOOP1)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that returns 0 for everything, while there is data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i replace it with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1375692834087454" jivemacro_uid="_1375692834087454"&gt;&lt;P&gt;Sum ({$&amp;lt;FACTDAT={"&amp;gt;$(=MAKEDATE(YEAR(NOW(2)-335), MONTH(NOW(2)-335))) &amp;lt;$(=MAKEDATE(YEAR(NOW(2)-305), MONTH(NOW(2)-305)))"}&amp;gt;} VERKOOP1)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does work... and gives the right values...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is this possible and what am I doing wrong... I can't use the -days because I won't know how many days there are between now and 11 months ago.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have an idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Aug 2013 08:09:11 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-08-05T08:09:11Z</dc:date>
    <item>
      <title>ADDMONTHS problem?</title>
      <link>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557371#M482561</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 want to make a table that has a column for every month from last year till now with the turnover in it, so I made:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13756928340881426" jivemacro_uid="_13756928340881426"&gt;&lt;P&gt;Sum ({$&amp;lt;FACTDAT={"&amp;gt;$(=MAKEDATE(YEAR(ADDMONTHS(NOW(2),-11)), MONTH(ADDMONTHS(NOW(2),-11))) &amp;lt;$(=MAKEDATE(YEAR(ADDMONTHS(NOW(2),-10,1)), MONTH(ADDMONTHS(NOW(2),-10,1)))"}&amp;gt;} VERKOOP1)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13756928477992185" jivemacro_uid="_13756928477992185"&gt;&lt;P&gt;Sum ({$&amp;lt;FACTDAT={"&amp;gt;=$(=monthname ( today(), -10 )) &amp;lt;$(=monthname ( today(), -9 ))"}, FIXEDCAR-={"DEL"}&amp;gt;} VERKOOP1)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that returns 0 for everything, while there is data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i replace it with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1375692834087454" jivemacro_uid="_1375692834087454"&gt;&lt;P&gt;Sum ({$&amp;lt;FACTDAT={"&amp;gt;$(=MAKEDATE(YEAR(NOW(2)-335), MONTH(NOW(2)-335))) &amp;lt;$(=MAKEDATE(YEAR(NOW(2)-305), MONTH(NOW(2)-305)))"}&amp;gt;} VERKOOP1)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does work... and gives the right values...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is this possible and what am I doing wrong... I can't use the -days because I won't know how many days there are between now and 11 months ago.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have an idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2013 08:09:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557371#M482561</guid>
      <dc:creator />
      <dc:date>2013-08-05T08:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: ADDMONTHS problem?</title>
      <link>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557372#M482562</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;The examples all give slightly different date values, which may play a part in why the 3rd example works and the others don't? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, I've attached an example that works (hopefully) with AddMonths() and I've used a different set analysis syntax, which I find easier to read (but that's just me, although I couldn't get your syntax to work, but maybe I was just having a cut and paste problem).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;Azam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2013 15:08:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557372#M482562</guid>
      <dc:creator>a_mullick</dc:creator>
      <dc:date>2013-08-05T15:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: ADDMONTHS problem?</title>
      <link>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557373#M482563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The set analysis is not right, it now only limits the values to smaller than today -2 months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it should be: &lt;/P&gt;&lt;P&gt;sum ({$&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FACTDAT={'&amp;gt;=$(=AddMonths(Today(), -5)) &amp;lt;=$(=AddMonths(Today(), -2))'}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;gt;}&lt;/P&gt;&lt;P&gt;Fact)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then it does work, thanks for that. &lt;/P&gt;&lt;P&gt;Will try this tomorrow in combination with monthstart &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2013 15:27:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557373#M482563</guid>
      <dc:creator />
      <dc:date>2013-08-05T15:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: ADDMONTHS problem?</title>
      <link>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557374#M482564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you're right. You correction should work (and with MonthStart() also).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Azam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2013 16:01:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ADDMONTHS-problem/m-p/557374#M482564</guid>
      <dc:creator>a_mullick</dc:creator>
      <dc:date>2013-08-05T16:01:03Z</dc:date>
    </item>
  </channel>
</rss>

