<?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 range in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570791#M1112093</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;To simplify the madness of date format conversion in set analysis you can use search capabilities using search expression.&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Date_Year_Month={"=Date_Year_Month&amp;gt;=AddMonths(Max(Date_Customer), -11)&amp;nbsp; and Date_Year_Month&amp;lt;Max(Date_Customer))"}&amp;gt;} DISTINCT IM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also optimize/simplify it by using $-sign expansion and variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Feb 2014 20:36:54 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2014-02-27T20:36:54Z</dc:date>
    <item>
      <title>Date range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570788#M1112087</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'm trying to make a date range selection using set analysis.&lt;/P&gt;&lt;P&gt;I found this great discussion:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/thread/82437"&gt;http://community.qlik.com/thread/82437&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfotunately i can't get it to work.&lt;/P&gt;&lt;P&gt;Here is my expression:&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Date_Year_Month={"&amp;gt;=$ (=Date(AddMonths(Max(Date_Customer), -11), 'YYYY-MM')) &amp;lt;$ (=Date(Max(Date_Customer),&amp;nbsp; 'YYYY-MM'))"}&amp;gt;} DISTINCT IM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field Date_Year_Month has the values as YYYY-MM&lt;/P&gt;&lt;P&gt;The field Date_Customer looks like YYY-MM-DD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried to put the calculations for the dates in variables and double checked so that they put out the correct dates by putting the variables in a text box.&lt;/P&gt;&lt;P&gt;With the dates in variables the expression looks like below:&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Date_Year_Month={"&amp;gt;=$ (='vMax_Months_minus1year') &amp;lt;$ (='vMax_Months')"}&amp;gt;} DISTINCT IM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 09:14:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570788#M1112087</guid>
      <dc:creator />
      <dc:date>2014-02-26T09:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570789#M1112089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it just not working when you use the variables?&amp;nbsp; Your syntax is a bit off:&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Date_Year_Month={'&amp;gt;=$(vMax_Months_minus1year)&amp;lt;$(vMax_Months)'}&amp;gt;} DISTINCT IM)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 19:14:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570789#M1112089</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-02-27T19:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570790#M1112091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I usually use a set operator "*"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Count({$&amp;lt;Date_Year_Month={"&amp;gt;=$ (=Date(AddMonths(Max(Date_Customer), -11), 'YYYY-MM'))"}*{"&amp;lt;$ (=Date(Max(Date_Customer),&amp;nbsp; 'YYYY-MM'))"}&amp;gt;} DISTINCT IM)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 20:06:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570790#M1112091</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2014-02-27T20:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570791#M1112093</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;To simplify the madness of date format conversion in set analysis you can use search capabilities using search expression.&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Date_Year_Month={"=Date_Year_Month&amp;gt;=AddMonths(Max(Date_Customer), -11)&amp;nbsp; and Date_Year_Month&amp;lt;Max(Date_Customer))"}&amp;gt;} DISTINCT IM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also optimize/simplify it by using $-sign expansion and variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 20:36:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570791#M1112093</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-02-27T20:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570792#M1112094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your help!&lt;/P&gt;&lt;P&gt;For some strange reason i couldn't get any of the proposed solutions to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I ended up doing was to create a variable called vLastYear that looks like this:&lt;/P&gt;&lt;P&gt;=chr(39)&amp;amp;Date(AddMonths(Max(Date_Customer), -11), 'YYYY-MM')&amp;nbsp; &amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -10), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -9), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -8), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -7), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -6), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -5), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -4), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -3), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -2), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(AddMonths(Max(Date_Customer), -1), 'YYYY-MM')&amp;amp; chr(39) &amp;amp; ', '&amp;amp;&lt;/P&gt;&lt;P&gt;chr(39) &amp;amp; Date(Max(Date_Customer),&amp;nbsp; 'YYYY-MM')&amp;amp; chr(39)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This result from the variable:&lt;/P&gt;&lt;P&gt;'2013-02', '2013-03', '2013-04', '2013-05', '2013-06', '2013-07', '2013-08', '2013-09', '2013-10', '2013-11', '2013-12', '2014-01'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I did the following set analysis in the graph:&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Date_Year_Month={$(=vLastYear)}&amp;gt;} DISTINCT IM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its not the prettiest solution but it gets the job done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thank you all for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 08:51:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/570792#M1112094</guid>
      <dc:creator />
      <dc:date>2014-02-28T08:51:22Z</dc:date>
    </item>
  </channel>
</rss>

