<?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 for date range in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150222#M375977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG style="text-decoration: line-through;"&gt;=&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="text-decoration: line-through;"&gt;Sum({$&amp;lt;DateFld={"&amp;gt;=$(Date(AddMonths(vDate.Today,-1),'DD/MM/YY'))&amp;lt;$(=Date(vDate.Today,'DD/MM/YY'))"}&amp;gt;} SalesValue)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;=Sum({$&amp;lt;DateFld={"&amp;gt;=$(=Date(MonthStart(vDate.Today,-1),'DD/MM/YYYY'))&amp;lt;$(=Date(MonthEnd(vDate.Today, -1),'DD/MM/YYYY'))"}&amp;gt;} SalesValue)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Update: Sample attached&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jul 2016 17:21:08 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-07-26T17:21:08Z</dc:date>
    <item>
      <title>Set analysis for date range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150221#M375976</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 struggling to get a set analysis working when the selection requires a range of values (in my case dates). Essentially I'm trying to SUM the values in a field where the 'date' is between a start date and end date. If I try to do this for a single date (the maximum selected for the minimum selected then all works well, but I cannot get it working for a range of dates. I have looked at various posts on this and similar forums and there are lots of other people trying to do the same thing but I can't seem to get mine working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample of what I have:&lt;/P&gt;&lt;P&gt;- my date values range from 2014-09-02 to 2014-12-02&lt;/P&gt;&lt;P&gt;- during my load script I set a variable (vDate.Today) to be the maximum date value (so 2014-12-02)&lt;/P&gt;&lt;P&gt;- I'm then trying to SUM a SalesValue for all rows in the previous calendar month (i.e. 2014-11-01 to 2014-11-30)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happens though is that the SUM is done for ALL rows &amp;lt;= 2014-11-30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my set analysis code, it looks like the ending date criteria works ok, but the starting date criteria does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my set analysis expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Sum({$&amp;lt;DateFld={"&amp;gt;=$(Date(AddMonths(vDate.Today,-1),'01/MM/YY'))"} , DateFld={"&amp;lt;$(=Date(vDate.Today,'01/MM/YY'))"}&amp;gt;} SalesValue) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attached qvw document also includes a text box where I display the start and end date values as calculated above. Those look fine to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All help gratefully received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 16:30:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150221#M375976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-26T16:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for date range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150222#M375977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG style="text-decoration: line-through;"&gt;=&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="text-decoration: line-through;"&gt;Sum({$&amp;lt;DateFld={"&amp;gt;=$(Date(AddMonths(vDate.Today,-1),'DD/MM/YY'))&amp;lt;$(=Date(vDate.Today,'DD/MM/YY'))"}&amp;gt;} SalesValue)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;=Sum({$&amp;lt;DateFld={"&amp;gt;=$(=Date(MonthStart(vDate.Today,-1),'DD/MM/YYYY'))&amp;lt;$(=Date(MonthEnd(vDate.Today, -1),'DD/MM/YYYY'))"}&amp;gt;} SalesValue)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Update: Sample attached&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 17:21:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150222#M375977</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-07-26T17:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for date range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150223#M375978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I Understand you need to get Nov total that is 112&lt;/P&gt;&lt;P&gt;use below expression &lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;DateFld={"&amp;gt;=$(=Date(AddMonths(vDate.Today,-1),'01/MM/YY')) &amp;lt;$(=Date(vDate.Today,'01/MM/YY'))"}&amp;gt;} SalesValue)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 17:25:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150223#M375978</guid>
      <dc:creator>maheshkuttappa</dc:creator>
      <dc:date>2016-07-26T17:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for date range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150224#M375979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for that, I got it working with one (very) minor change).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You had coded:&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;DateFld={"&amp;gt;=$(=Date(MonthStart(vDate.Today,-1),'DD/MM/YYYY'))&amp;lt;$(=Date(MonthEnd(vDate.Today, -1),'DD/MM/YYYY'))"}&amp;gt;} SalesValue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second value is tested using "&amp;lt;", which (of course) would exclude any data for the last day of the month. I need to include data for that date, so I just changed "&amp;lt;" to "&amp;lt;=". (as I said, a minor change).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 09:42:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150224#M375979</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-27T09:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for date range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150225#M375980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks - works a treat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 09:43:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-for-date-range/m-p/1150225#M375980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-27T09:43:10Z</dc:date>
    </item>
  </channel>
</rss>

