<?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: Date calculation help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774546#M274767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;= sum({$&amp;lt;[TransactionLinesDate] = {'&amp;gt;=$(=AddMonths(Date#(vStartDate,'DD/MM/YYYY'),-1))&amp;lt;=$(=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;AddMonths(&lt;/SPAN&gt;Date#(vEndDate&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;,'DD/MM/YYYY'&lt;/SPAN&gt;),-1))'},&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[TransactionLinesType] = {'I', 'C', 'T'}&amp;gt;}&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;TransactionLinesAmount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Feb 2015 02:40:18 GMT</pubDate>
    <dc:creator>anbu1984</dc:creator>
    <dc:date>2015-02-10T02:40:18Z</dc:date>
    <item>
      <title>Date calculation help</title>
      <link>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774545#M274766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum({$&amp;lt;[TransactionLinesDate] = {'&amp;gt;=$(=Date(vStartDate))&amp;lt;=$(=Date(vEndDate))'},&lt;/P&gt;&lt;P&gt;[TransactionLinesType] = {'I', 'C', 'T'}&amp;gt;}&lt;/P&gt;&lt;P&gt;TransactionLinesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vStartDate and vEndDate are typically the beginning of the month so we may have value 01/01/2015 (42005) and 01/02/2015 (42036).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to repeat the above calculation but for the month before - in other words instead of calculating for start of January until start of February, I want start of December 2014 to start of January 2015.... &lt;/P&gt;&lt;P&gt;In other words I want vStartDate and vEndDate to be adjusted by one less month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have even tried the following and cannot get it to work...&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;= sum({$&amp;lt;[TransactionLinesDate] = {'&amp;gt;=$(=Date(vStartDate - 31))&amp;lt;=$(=Date(vEndDate - 31))'},&lt;/P&gt;&lt;P&gt;[TransactionLinesType] = {'I', 'C', 'T'}&amp;gt;}&lt;/P&gt;&lt;P&gt;TransactionLinesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 02:35:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774545#M274766</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2015-02-10T02:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Date calculation help</title>
      <link>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774546#M274767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;= sum({$&amp;lt;[TransactionLinesDate] = {'&amp;gt;=$(=AddMonths(Date#(vStartDate,'DD/MM/YYYY'),-1))&amp;lt;=$(=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;AddMonths(&lt;/SPAN&gt;Date#(vEndDate&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;,'DD/MM/YYYY'&lt;/SPAN&gt;),-1))'},&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[TransactionLinesType] = {'I', 'C', 'T'}&amp;gt;}&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;TransactionLinesAmount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 02:40:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774546#M274767</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-02-10T02:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date calculation help</title>
      <link>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774547#M274768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Anbu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I adapted what you suggested and got the desired result with the following - for some reason I was not getting the desired result with Date# and the formatting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[TransactionLinesDate] = {'&amp;gt;=$(=AddMonths(Date(vStartDate),-1))&amp;lt;=$(=AddMonths(Date(vEndDate),-1))'},&lt;/P&gt;&lt;P&gt;[TransactionLinesType] = {'I', 'C', 'T'}&amp;gt;}&lt;/P&gt;&lt;P&gt;TransactionLinesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 02:54:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774547#M274768</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2015-02-10T02:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Date calculation help</title>
      <link>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774548#M274769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the values stored in &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vStartDate and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vEndDate are date, then you can directly use Addmonths() without Date()&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 02:59:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774548#M274769</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-02-10T02:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date calculation help</title>
      <link>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774549#M274770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;vStartDate and vEndDate are numeric (e.g. 42005 for 01/01/2015) hence why I "Date" them and then deduct 1 month as you suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 09:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-calculation-help/m-p/774549#M274770</guid>
      <dc:creator>alexis</dc:creator>
      <dc:date>2015-02-10T09:33:07Z</dc:date>
    </item>
  </channel>
</rss>

