<?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 analysis - range of dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-range-of-dates/m-p/639521#M234436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum({&amp;lt;YearMonth={'&amp;lt;=$(=max(Date#(YearMonth,'YYYYMM')))&amp;gt;=$(=addmonths(max(Date#(YearMonth,'YYYYMM')),3))'}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you might have play with&amp;nbsp; the date function on top of inner dates depends on how is your field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jun 2014 14:18:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-04T14:18:37Z</dc:date>
    <item>
      <title>Set analysis - range of dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-range-of-dates/m-p/639520#M234435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to sum an amount within specificed a specfici year/month time frame.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;The fields:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Amount&lt;/P&gt;&lt;P&gt;YYYYMM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to sum the Amount field for the max of YYYYMM and the preceding 3 months. I know I could do it the long way by adding Max, Max-1, max-2 and max-3 in separate set analysis expressions but thought there would be some way to do it in one concise expression with set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 14:12:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-range-of-dates/m-p/639520#M234435</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2014-06-04T14:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - range of dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-range-of-dates/m-p/639521#M234436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum({&amp;lt;YearMonth={'&amp;lt;=$(=max(Date#(YearMonth,'YYYYMM')))&amp;gt;=$(=addmonths(max(Date#(YearMonth,'YYYYMM')),3))'}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you might have play with&amp;nbsp; the date function on top of inner dates depends on how is your field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 14:18:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-range-of-dates/m-p/639521#M234436</guid>
      <dc:creator />
      <dc:date>2014-06-04T14:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - range of dates</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-range-of-dates/m-p/639522#M234437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your YYYYMM field can't easlily be calculated with as it is. What you can do is make a date field from it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...some fields...,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Amount,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; date#(YearMonthField, 'YYYYMM') as YearMonthField&lt;/P&gt;&lt;P&gt;From ...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you've done that you can calculate with the YearMonthField using date functions since the underlying values are dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;YearMonthField={'&amp;gt;=$(=monthstart(max(YearMonthField)),-3))'}&amp;gt;} Amount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 14:25:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-range-of-dates/m-p/639522#M234437</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-04T14:25:17Z</dc:date>
    </item>
  </channel>
</rss>

