<?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: Calculate difference in months and then AddMonths in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636282#M1090829</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&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;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit; color: #808080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;$(MonthDiff(StartDate))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &amp;gt; 12, AddMonths(StartDate, 12), 0)) AS NewDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM DataSource;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2014 01:57:09 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2014-06-03T01:57:09Z</dc:date>
    <item>
      <title>Calculate difference in months and then AddMonths</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636281#M1090828</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 trying to count the number of months between a date and today AND then if the result is over 12 months, add 12 months to create a new date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my script I have set the following variable:&lt;BR /&gt;&lt;STRONG&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SET &lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;MonthDiff&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=((year(today(2))*12)+month(today(2))) - (((year($1)*12)+month($1))); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt;In my table I have the following expression to begin with.&amp;nbsp; I will build this up to vary for 24 months, 36 etc...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;count&lt;/SPAN&gt;&lt;SPAN&gt;({&amp;lt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(MonthDiff(StartDate))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt; = {'&amp;gt;12'}&amp;gt;}), AddMonths(StartDate, 12), 0)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The components on their own work - monthdiff gives me the expected results, and AddMonths works too.&amp;nbsp; However, combined above it is giving me blanks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 01:44:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636281#M1090828</guid>
      <dc:creator />
      <dc:date>2014-06-03T01:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference in months and then AddMonths</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636282#M1090829</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&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;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit; color: #808080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;$(MonthDiff(StartDate))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &amp;gt; 12, AddMonths(StartDate, 12), 0)) AS NewDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM DataSource;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 01:57:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636282#M1090829</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-06-03T01:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference in months and then AddMonths</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636283#M1090830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan - that worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I change it to more than 12 but less than 24??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 02:14:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636283#M1090830</guid>
      <dc:creator />
      <dc:date>2014-06-03T02:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference in months and then AddMonths</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636284#M1090831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;*,&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;(&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit; color: #808080;"&gt;$(MonthDiff(StartDate))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; &amp;gt; 12 AND &lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; font-style: inherit;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit; color: #808080;"&gt;$(MonthDiff(StartDate))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; font-style: inherit; font-weight: inherit;"&gt; &amp;lt; 24&lt;/SPAN&gt;, AddMonths(StartDate, 12), 0)) AS NewDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;FROM DataSource;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #edf8ca;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Jagan.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 02:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-difference-in-months-and-then-AddMonths/m-p/636284#M1090831</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-06-03T02:15:10Z</dc:date>
    </item>
  </channel>
</rss>

