<?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: Set Expression with Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446047#M487038</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - just to clarify - really I am looking to use the system month as the comparison tool - vs entering a date.&amp;nbsp; Also - I did link the demanddate field on the table to a master calendar to create fields for Demandweek, demandyear, demandmonth and demandday.&amp;nbsp; So really this should be a simple comparison of the current(system) month +1 month to the demandmonth field - and then a sum of the demand.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Feb 2013 15:38:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-02-18T15:38:40Z</dc:date>
    <item>
      <title>Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446042#M487033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think this should be too hard but having trouble getting the set expression to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to sum on a field called demand where the demand occurs in the current month + 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For examples - I have a series of demand entries - time with different dates attached in the future.&amp;nbsp; I want to pull in the demand where the date is in March (Feb + 1).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My fields are:&lt;/P&gt;&lt;P&gt;- DemandMonth - this is the month where the demand occurs&lt;/P&gt;&lt;P&gt;- Demand - this is the amount of hours&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a master calendar that is linked to the date and creates the demandmonth field&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 15:17:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446042#M487033</guid>
      <dc:creator />
      <dc:date>2013-02-18T15:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446043#M487034</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;If your field DemandMonth is numeric, I suggest you to do that :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MakeDate(Year(Today()), DemandMonth) as DemandDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Demand&lt;/P&gt;&lt;P&gt;FROM Data.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;LOAD Distinct DemandDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName(DemandDate) as DemandYearMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(DemandDate) as DemandMonth&lt;/P&gt;&lt;P&gt;RESIDENT Data;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;After that, you have to use something like this in design part :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Sum({&amp;lt;DemandMonth={"$(=MonthName(Today(),1))"}&amp;gt;} Demand)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin Favier&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 15:29:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446043#M487034</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2013-02-18T15:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446044#M487035</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;If your field DemandMonth is numeric, I suggest you to do that :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MakeDate(Year(Today()), DemandMonth) as DemandDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Demand&lt;/P&gt;&lt;P&gt;FROM Data.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;LOAD Distinct DemandDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName(DemandDate) as DemandYearMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(DemandDate) as DemandMonth&lt;/P&gt;&lt;P&gt;RESIDENT Data;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;After that, you have to use something like this in design part :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Sum({&amp;lt;DemandMonth={"$(=MonthName(Today(),1))"}&amp;gt;} Demand)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin Favier&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 15:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446044#M487035</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2013-02-18T15:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446045#M487036</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;If your field DemandMonth is numeric, I suggest you to do that :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MakeDate(Year(Today()), DemandMonth) as DemandDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Demand&lt;/P&gt;&lt;P&gt;FROM Data.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;LOAD Distinct DemandDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName(DemandDate) as DemandYearMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(DemandDate) as DemandMonth&lt;/P&gt;&lt;P&gt;RESIDENT Data;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;After that, you have to use something like this in design part :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Sum({&amp;lt;DemandMonth={"$(=MonthName(Today(),1))"}&amp;gt;} Demand)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin Favier&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 15:30:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446045#M487036</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2013-02-18T15:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446046#M487037</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 this expression, suppose if you select Feb-2013, then the below expression will give you the demand for Mar-2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;DateField={'&amp;gt;=$(=AddMonths(MonthStart(Max(DateField)), 1)&amp;lt;=$(=AddMonths(MonthEnd(Max(DateField)), 1))'}&amp;gt;} Demand)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 15:33:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446046#M487037</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-02-18T15:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446047#M487038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - just to clarify - really I am looking to use the system month as the comparison tool - vs entering a date.&amp;nbsp; Also - I did link the demanddate field on the table to a master calendar to create fields for Demandweek, demandyear, demandmonth and demandday.&amp;nbsp; So really this should be a simple comparison of the current(system) month +1 month to the demandmonth field - and then a sum of the demand.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 15:38:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446047#M487038</guid>
      <dc:creator />
      <dc:date>2013-02-18T15:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446048#M487039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this but it in not returning the values for March - current month +1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Demand Month]&lt;/SPAN&gt;&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;$(AddMonths(Month,1))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 20:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446048#M487039</guid>
      <dc:creator />
      <dc:date>2013-02-18T20:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446049#M487040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Sometimes the problem is the date format. I always use fields in numeric format to avoid this problem. &lt;/P&gt;&lt;P&gt;This approach is suggested in this document: &lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/docs/DOC-3102" title="http://community.qlik.com/docs/DOC-3102"&gt;http://community.qlik.com/docs/DOC-3102&lt;/A&gt; (check tip 5) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I suggest you create a field like this in script: &lt;/P&gt;&lt;P&gt;Load ... , num( monthstart( [Demand Month] ) ) as nDemandMonth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set analysis will be: &lt;/P&gt;&lt;P&gt;sum( {&amp;lt;nDemandMonth = {$(=num( monthstart( today())))}&amp;gt;} Value) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 14:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446049#M487040</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2013-02-19T14:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446050#M487041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This recent blog post is also very interesting: &lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/02/19/why-don-t-my-dates-work" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/19/why-don-t-my-dates-work"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/19/why-don-t-my-dates-work&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 17:50:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446050#M487041</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2013-02-19T17:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446051#M487042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eric – This is what I have in my master calendar mapping:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QuartersMap:&lt;/P&gt;&lt;P&gt;MAPPING LOAD&lt;/P&gt;&lt;P&gt;rowno() as DemandDate,&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; Ceil (rowno()/3) as Quarter&lt;/P&gt;&lt;P&gt;AUTOGENERATE (12);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;               min(DemandDate) as minDate,&lt;/P&gt;&lt;P&gt;               max(DemandDate) as maxDate&lt;/P&gt;&lt;P&gt;Resident DemandDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let varMinDate = Num(Peek('minDate', 0, 'Temp'));&lt;/P&gt;&lt;P&gt;Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));&lt;/P&gt;&lt;P&gt;DROP Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempCalendar:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;               $(varMinDate) + Iterno()-1 As Num,&lt;/P&gt;&lt;P&gt;               Date($(varMinDate) + IterNo() - 1) as TempDate&lt;/P&gt;&lt;P&gt;               AutoGenerate 1 While $(varMinDate) + IterNo() -1 } Demand)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 18:18:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446051#M487042</guid>
      <dc:creator />
      <dc:date>2013-02-19T18:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446052#M487043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's the format of [Demand Month] or Month in your expression? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Arial; font-size: 11px; background-color: #ffffff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; color: #0000ff; font-family: Arial;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; font-family: Arial; color: #800000;"&gt;[Demand Month]&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; color: #0000ff; font-family: Arial;"&gt; = {&lt;/SPAN&gt;&lt;STRONG style="background-color: #ffffff; font-size: 11px; color: #0000ff; font-family: Arial;"&gt;&lt;EM style="font-size: 8pt; color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="font-size: 8pt;"&gt;$(AddMonths(Month,1))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes, addmonths or other functions will reset the format to a date or timestamp.&lt;/P&gt;&lt;P&gt;You can try this: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Arial; font-size: 11px; background-color: #ffffff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; color: #0000ff; font-family: Arial;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; font-family: Arial; color: #800000;"&gt;[Demand Month]&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; color: #0000ff; font-family: Arial;"&gt; = {&lt;/SPAN&gt;&lt;STRONG style="background-color: #ffffff; font-size: 11px; color: #0000ff; font-family: Arial;"&gt;&lt;EM style="font-size: 8pt; color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="font-size: 8pt;"&gt;$(=num(AddMonths(Month,1)))} &amp;gt; } Value)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you try this fuction in a straight table without any label on the expression, you will be able to see what happend inside the {}. There, it should be like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Arial; font-size: 11px; background-color: #ffffff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; color: #0000ff; font-family: Arial;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; font-family: Arial; color: #800000;"&gt;[Demand Month]&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 8pt; color: #0000ff; font-family: Arial;"&gt; = {3} &amp;gt;} Value&lt;/SPAN&gt;&lt;STRONG style="background-color: #ffffff; font-size: 11px; color: #0000ff; font-family: Arial;"&gt;&lt;EM style="font-size: 8pt; color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="font-size: 8pt;"&gt;)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&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;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 18:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446052#M487043</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2013-02-19T18:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446053#M487044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is what I got in the label:&amp;nbsp; sum({&amp;lt;[DemandMonth] = {41306} &amp;gt; } Demand)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 19:20:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446053#M487044</guid>
      <dc:creator />
      <dc:date>2013-02-19T19:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446054#M487045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok&lt;/P&gt;&lt;P&gt;What do you have when you put the field DemandMonth in a listbox? It should be in the same format ( 41000, for example). &lt;/P&gt;&lt;P&gt;If it is not, you can set it in document settings -&amp;gt; number ( be careful to not include thousand separators or decimals). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check if the value 41306 exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 03:15:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446054#M487045</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2013-02-20T03:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression with Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446055#M487046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erich,&lt;/P&gt;&lt;P&gt;I got some help from a QV resource and what we did was set up an environment variable in the settings for the current month, next month, etc.  Then we referenced the variable in the set expression.  This worked and solved the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 13:22:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Expression-with-Dates/m-p/446055#M487046</guid>
      <dc:creator />
      <dc:date>2013-02-20T13:22:43Z</dc:date>
    </item>
  </channel>
</rss>

