<?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: InMonths function giving strange results in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/InMonths-function-giving-strange-results/m-p/1123524#M631274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want to color 6 months for this year and last year? May be 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;If(InMonths(6,Max([Order Date]), Today(), -1) &lt;SPAN style="color: #ff0000;"&gt;or &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InMonths(6,Max([Order Date]), AddYears(Today(), -1), -1)&lt;/SPAN&gt;, Red())&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jun 2016 01:11:59 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-06-28T01:11:59Z</dc:date>
    <item>
      <title>InMonths function giving strange results</title>
      <link>https://community.qlik.com/t5/QlikView/InMonths-function-giving-strange-results/m-p/1123523#M631273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone, &lt;/P&gt;&lt;P&gt;I have a question regarding the inmonths function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to colour code sales from customers that are older that 6 months ago.&lt;/P&gt;&lt;P&gt;Here is what I'm using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Equation:&lt;/P&gt;&lt;P&gt;if (inmonths (6, Max( [Order Date] ), Today(), -1), Red() )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem: January, February, March, April, May, and June of previous years are not being colour coded. I have attached a small screen shot Due to the number of records you can't see much of the previous information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My source for inmonths function:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/sense/2.2/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions/inmonthstodate.htm" title="http://help.qlik.com/en-US/sense/2.2/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions/inmonthstodate.htm"&gt;http://help.qlik.com/en-US/sense/2.2/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions/inmonthstodate.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 15:53:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/InMonths-function-giving-strange-results/m-p/1123523#M631273</guid>
      <dc:creator>shearwatertroy</dc:creator>
      <dc:date>2016-06-27T15:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: InMonths function giving strange results</title>
      <link>https://community.qlik.com/t5/QlikView/InMonths-function-giving-strange-results/m-p/1123524#M631274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want to color 6 months for this year and last year? May be 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;If(InMonths(6,Max([Order Date]), Today(), -1) &lt;SPAN style="color: #ff0000;"&gt;or &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;InMonths(6,Max([Order Date]), AddYears(Today(), -1), -1)&lt;/SPAN&gt;, Red())&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2016 01:11:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/InMonths-function-giving-strange-results/m-p/1123524#M631274</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-28T01:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: InMonths function giving strange results</title>
      <link>https://community.qlik.com/t5/QlikView/InMonths-function-giving-strange-results/m-p/1123525#M631275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is close, but I want to set a user defined variable for how many months they want to go back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plus I want to highlight everything from 6 months back.&lt;/P&gt;&lt;P&gt;So if customer A hasn't purchased anything since December 2014 I want to be able to see that highlighted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the second part of your equation, it's limiting the scope to 1 year prior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One solution I came up with was:&lt;/P&gt;&lt;P&gt;if( (Year (Max ( [Order Date] ) ) &amp;lt;&amp;gt; Year (Today () ) or ( inmonths ( varMonthLimit, Max ( [Order Date] ), Today (), -1) ) ) , Red() )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which highlights everything NOT within this calendar year and X months back. Problem with this, is that in January, everything in December is highlighted red because it's not in the calendar year. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2016 19:25:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/InMonths-function-giving-strange-results/m-p/1123525#M631275</guid>
      <dc:creator>shearwatertroy</dc:creator>
      <dc:date>2016-06-28T19:25:11Z</dc:date>
    </item>
  </channel>
</rss>

