<?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: YearMonth subtraction in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249669#M94847</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;Why not? Do you have continuous axes? What fields do you have available to show in the chart? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Oct 2011 07:16:46 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-10-17T07:16:46Z</dc:date>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249660#M94838</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 found a problem with my max(YearMonth) - x expression. &lt;/P&gt;&lt;P&gt;When it comes to overlaping Years. Say that max(YearMonth) = 201110 and mu expression is max(YearMonth)-11 i get 201190 when i wanted it to be 201011.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need to rank YearMonth instead in the script before doing this expression or any better ideas? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 10:20:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249660#M94838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-14T10:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249661#M94839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look this if is useful for u&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 10:45:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249661#M94839</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-14T10:45:52Z</dc:date>
    </item>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249662#M94840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For some reason i can't download files from here. Probably firewall. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 11:52:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249662#M94840</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-14T11:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249663#M94841</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;That YearMonth is not a date in itself. You can do that using Date(Field, 'YYYYMM') so there is an underlying numeric value that will allow you to add or substract. But I find easier to use always in your charts the main Date field in the expressions and a range from-to, something like&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"&gt;&lt;P&gt;Sum({&amp;lt; DateField = {'&amp;gt;=MonthStart(AddYears(Today(), -1))&amp;lt;=$(=MonthEnd(Today()))'} &amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your dimension is MonthYear you will get as you expect instead of doing some tricky sorting by expression and so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small active_link" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: I had an example on this. Check both charts in the attached example and see how YearMonth is sorted right nby date, and DateField is the one used in the expressions. All right, you cannot download QVW files, then check the following script:&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"&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD Chr(64 + Ceil(Rand() * 3)) AS ID,&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;nbsp; Date('01/01/2009' + Ceil(Rand() * 1300)) AS DateField,&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;nbsp; Ceil(Rand() * 1000) AS Amount&lt;/P&gt;&lt;P&gt;AUTOGENERATE 20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;LOAD DateField,&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;nbsp; Text(Date(DateField, 'YYYYMM')) AS YearMonth&lt;/P&gt;&lt;P&gt;RESIDENT Table;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now create a new bar chart, set YearMonth as dimension and the following as expression:&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"&gt;&lt;P&gt;Sum({&amp;lt; DateField = {'&amp;gt;=$(=MonthStart(AddYears(Today(), -1)))&amp;lt;=$(=MonthEnd(AddMonths(Today(), -3)))'} &amp;gt;} Amount)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to the Sort tab, click on YearMonth, check "Expression" and type just DateField.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 12:00:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249663#M94841</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-14T12:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249664#M94842</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;one simple suggestion&amp;nbsp; instead of representing yearmonth like this 201110 try like this 2011010(YearMon)&lt;/P&gt;&lt;P&gt;such that when u substract also 2011010-1&amp;nbsp; =2011009&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 12:31:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249664#M94842</guid>
      <dc:creator>spsrk_84</dc:creator>
      <dc:date>2011-10-14T12:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249665#M94843</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;one simple suggestion&amp;nbsp; instead of representing yearmonth like this 201110 try like this 2011010(YearMon)&lt;/P&gt;&lt;P&gt;such that when u substract also 2011010-1&amp;nbsp; =2011009&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 12:32:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249665#M94843</guid>
      <dc:creator>spsrk_84</dc:creator>
      <dc:date>2011-10-14T12:32:04Z</dc:date>
    </item>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249666#M94844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But in my chart i can't use year month as a dimension. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 06:27:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249666#M94844</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-17T06:27:18Z</dc:date>
    </item>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249667#M94845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will still give me a problem with subtraction over years. 201100101 - 1 = 201100100&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 06:28:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249667#M94845</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-17T06:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249668#M94846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;convert the Month year into MMM YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use as attached file to substract YearMonth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 07:08:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249668#M94846</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2011-10-17T07:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249669#M94847</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;Why not? Do you have continuous axes? What fields do you have available to show in the chart? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 07:16:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249669#M94847</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-17T07:16:46Z</dc:date>
    </item>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249670#M94848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I mean that in my chart it's not ment to show year month. i have a straight table where i look at departments and how well they're doing certain periods of time. past 3 months, past 6 months, past 12 months. aggregated. So this is why i "can't" show yearmonth as a dimension. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 07:24:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249670#M94848</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-17T07:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249671#M94849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All right,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I got it now. Then you only need to specify a range of dates in your set analysis. Say you want to show sales for the last 3 months (starting today, 3 months backwards or 17/08/2011 - 17/10/2011), your expression should be&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"&gt;&lt;P&gt;Sum({&amp;lt; DateField = {"&amp;gt;=$(=AddMonts(Today(), -3))&amp;lt;=$(=Date(Today()))"} &amp;gt;} Sales)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regardless your dimensions. You can use MonthField as dimension to show Oct, Sep and Aug, in the case above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the format returned by the functions AddMonths() and Date() must be the same that DateField.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 07:33:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249671#M94849</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-17T07:33:49Z</dc:date>
    </item>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249672#M94850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem is, we want to see whole months. So if today is 2011-10-17 the three months vill be &lt;/P&gt;&lt;P&gt;2011-07-01 to 2011-09-30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 12:30:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249672#M94850</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-17T12:30:28Z</dc:date>
    </item>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249673#M94851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is there a way to get the beginning of the month with addmonths function? I mean the end is doable but i can't find the start thing(?). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 12:36:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249673#M94851</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-17T12:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249674#M94852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;are you asking about&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;monthstart(addmonth(date,-1)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;monthstart(date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 12:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249674#M94852</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2011-10-17T12:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249675#M94853</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;What I wrote above was just an example. There are dozens of functions you can use, but in your particular case (three complete months from 01/07/2011 to 30/09/2011) the correct syntax should be:&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"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sum({&amp;lt; DateField = {"&amp;gt;=$(=AddMonths(MonthStart(Today()), -4))&amp;lt;=$(=MonthEnd(AddMonths(Today(), -1)))"} &amp;gt;} Sales)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this kind of time analysis will take place usually in your chart, I recommend you to create a master calendar linked to your main fact table, where you set a flag field to know quickly the last three months, last quarter, last month, last year and so. Check &lt;A _jive_internal="true" href="https://community.qlik.com/community.qlik.com/qlikviews/1075"&gt;this application&lt;/A&gt; on how to create it and many other posts in the QlikCommunity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps and gives you an idea on how to move ahead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; text-decoration: underline; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 15:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249675#M94853</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-17T15:44:30Z</dc:date>
    </item>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249676#M94854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! Very helpful! Canät download the aplication right now though but is there a same way to du with weeks or do i have to work with dates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 10:32:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249676#M94854</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-18T10:32:38Z</dc:date>
    </item>
    <item>
      <title>YearMonth subtraction</title>
      <link>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249677#M94855</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 alway do likewise, using the DateField (or whatever is named in your application) in the left part of the equal in the set analysis, and using date functions to get the proper range of dates in the right part of the equal sign. This is the best way to get the results as you expect without playing with string functions that usually perform poorer than the numeric ones (dates are numeric in QlikView).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you cannot download the file I can send it to you by email so you can check botht he script and the charts where this kind of expressions are used, let me know anyway by PM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 10:36:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/YearMonth-subtraction/m-p/249677#M94855</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-18T10:36:26Z</dc:date>
    </item>
  </channel>
</rss>

