<?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/965088#M946529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=count({$&amp;lt;ts={"&amp;gt;=$(=Date(vTestDate-2))&amp;lt;=$(=Date(vTestDate))"} &amp;gt;} value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and change the calendar object constraints so that it allows a proper variable selection&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Dec 2015 21:47:21 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2015-12-21T21:47:21Z</dc:date>
    <item>
      <title>Date range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965081#M946522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having an issue with date range in set analysis. I have checked many an examples on this site but none seem to work.&lt;/P&gt;&lt;P&gt;What I am doing is select a date via calendar tool, set the variable vTestDate, then I want to see the count of dates or values for each date change on the basis of selection. I have attached a qvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data is like&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; ts, group, alt, value Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;&amp;nbsp; ts, group, alt, value&lt;BR /&gt;2/12/2015,A,x,1.1&lt;BR /&gt;2/13/2015,A,x,1.2&lt;BR /&gt;2/14/2015,A,x,1.3&lt;BR /&gt;2/15/2015,A,x,1.4&lt;BR /&gt;2/16/2015,A,x,1.5&lt;BR /&gt;2/17/2015,A,x,1.6&lt;BR /&gt;2/18/2015,A,x,1.7&lt;BR /&gt;2/12/2015,B,y,1.8&lt;BR /&gt;2/13/2015,B,y,1.9&lt;BR /&gt;2/14/2015,B,y,2&lt;BR /&gt;2/16/2015,B,y,2.2&lt;BR /&gt;2/17/2015,B,y,2.3&lt;BR /&gt;2/18/2015,B,y,2.4&lt;BR /&gt;2/12/2015,C,z,2.5&lt;BR /&gt;2/13/2015,C,z,2.6&lt;BR /&gt;2/14/2015,C,z,2.7&lt;BR /&gt;2/17/2015,C,z,2.8&lt;BR /&gt;2/18/2015,C,z,2.9&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then create pivot table with 3 expressions&lt;/P&gt;&lt;P&gt;1. count(value)&lt;/P&gt;&lt;P&gt;2. count({$&amp;lt;group={A,B,C} &amp;gt;} value)&lt;/P&gt;&lt;P&gt;3. count({$&amp;lt;ts={'&amp;lt;$(vTestDate)-1'} &amp;gt;} value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression 1 and 2 produce right results.&lt;/P&gt;&lt;P&gt;However, the expression 3 has two issues&lt;/P&gt;&lt;P&gt;a. it does not provide the correct count based on selected vTestDate. I tried using today() also, not much luck.&lt;/P&gt;&lt;P&gt;b. it does not respond to change in subtraction, be it -1 or -10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your prompt reply&lt;/P&gt;&lt;P&gt;Varum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Varum Reddy
correct the column header for the table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 16:26:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965081#M946522</guid>
      <dc:creator />
      <dc:date>2015-12-21T16:26:08Z</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/965082#M946523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this&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;count({$&amp;lt;ts={'&amp;lt;$(date(vTestDate)-1)'} &amp;gt;} value)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 18:58:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965082#M946523</guid>
      <dc:creator />
      <dc:date>2015-12-21T18:58:32Z</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/965083#M946524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({$&amp;lt;ts={"$(=Date(vTestDate-1))"}&amp;gt;} value)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 18:58:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965083#M946524</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-21T18:58:40Z</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/965084#M946525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does not work if I want set of dates less than vTestDate - gives 0 count&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;for example,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=count({$&amp;lt;ts={'$(&amp;lt;Date(vTestDate))'}&amp;gt;} value) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 20:12:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965084#M946525</guid>
      <dc:creator />
      <dc:date>2015-12-21T20:12:12Z</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/965085#M946526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Count in the set does not change with vTestDate or the subtraction - always the total of the unfiltered set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 20:14:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965085#M946526</guid>
      <dc:creator />
      <dc:date>2015-12-21T20:14:01Z</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/965086#M946527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ideally, I need it to work for the date range of vTestDate-2 to vTestDate. In reality, 2 could be 30, 60 or 90 on the actual dataset.&lt;/P&gt;&lt;P&gt;I had tried for days various date range suggestions on this community, but none produced expected results. That is the reason I created the qvw for you to see the results too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 20:52:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965086#M946527</guid>
      <dc:creator />
      <dc:date>2015-12-21T20:52: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/965087#M946528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Try this&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;count({$&amp;lt;ts={'&amp;lt;$(=date(vTestDate-1))'} &amp;gt;} value)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 21:32:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965087#M946528</guid>
      <dc:creator />
      <dc:date>2015-12-21T21:32:23Z</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/965088#M946529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=count({$&amp;lt;ts={"&amp;gt;=$(=Date(vTestDate-2))&amp;lt;=$(=Date(vTestDate))"} &amp;gt;} value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and change the calendar object constraints so that it allows a proper variable selection&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 21:47:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965088#M946529</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-21T21:47: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/965089#M946530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both of the following syntax work. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; count({$&amp;lt;ts={'&amp;gt;$(=date(vTestDate-2))&amp;lt;=$(=date(vTestDate)) '} &amp;gt;} value)&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ts&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'&amp;gt;$(=vTestDate-3)&amp;lt;=$(=vTestDate) '} &amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt;I am curious why is the dollar-sign expansion necessary? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 22:03:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965089#M946530</guid>
      <dc:creator />
      <dc:date>2015-12-21T22:03:43Z</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/965090#M946531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4076"&gt;A Primer on Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 22:29:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965090#M946531</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-21T22:29:58Z</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/965091#M946532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Varum I am going to share a method I use whenever it comes to dates. I have seen a lot of people struggling when it comes to date and but this method has never let me down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever I want to use dates within set analysis, I usually create a text box with the range I want to cover in my set analysis. For your case, lets say you want between vTestDate-2 and vTestDate. I would create a text box like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;='&amp;gt;=' &amp;amp; Date(vTestDate -2) &amp;amp; '&amp;lt;=' &amp;amp; Date(vTestDate)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should show the date range you want and in the format if your date field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="109646" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/109646_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;and bingo it does. Next step is fairly simple;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy the whole text box expression and paste it between the parenthesis-&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&amp;lt;DateField = {"$()"}&amp;gt;} &lt;/STRONG&gt;-&amp;gt; &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;{&amp;lt;DateField = {"$(&lt;SPAN style="color: #ff0000; font-size: 13.3333px;"&gt;&lt;STRONG&gt;='&amp;gt;=' &amp;amp; Date(vTestDate -2) &amp;amp; '&amp;lt;=' &amp;amp; Date(vTestDate)&lt;/STRONG&gt;&lt;/SPAN&gt;)"}&amp;gt;} &lt;/STRONG&gt;&lt;/SPAN&gt;and you should be all set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression -&amp;gt; &lt;STRONG&gt;=Count({$&amp;lt;ts={"$(='&amp;gt;=' &amp;amp; Date(vTestDate-2) &amp;amp; '&amp;lt;=' &amp;amp; Date(vTestDate))"}&amp;gt;} value)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="109647" alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/109647_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope after today you will probably &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;NOT&lt;/STRONG&gt;&lt;/SPAN&gt; need to worry about using date range in your set analysis ever again &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 01:44:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965091#M946532</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-22T01:44:44Z</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/965092#M946533</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;Check this link for lot of examples similar to this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-9162"&gt;Set Analysis for certain Point in Time&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 01:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965092#M946533</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-12-22T01:55:12Z</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/965093#M946534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I&amp;nbsp; mix this date range, at least, with a negation (-=) filter criteria, in the qvw, I attached, QV does not like it in the expression box. But it seems to produce correct results. I am wondering if it is okay to use this or is there a better way to use " not in " clause in the set.&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/109745_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 20:26:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965093#M946534</guid>
      <dc:creator />
      <dc:date>2015-12-22T20:26:32Z</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/965094#M946535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you are using is not wrong. I am guessing you are using QV 11.20 SR 8 or below? This is just suggesting that QlikView's Expression Editor doesn't understand the script, but there is nothing wrong with the expression itself. If you update to newer versions, you won't see those red wiggly lines for using -= in set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 21:22:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/965094#M946535</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-22T21:22:20Z</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/1679199#M946536</link>
      <description>&lt;P&gt;Thank you so much! I've been looking for the solution for 4 hr+&lt;span class="lia-unicode-emoji" title=":squinting_face_with_tongue:"&gt;😝&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I had a similar but different case and I'd like to share:&lt;/P&gt;&lt;P&gt;I want to filter data by a user defined date range.&lt;/P&gt;&lt;P&gt;This code works for me:&lt;/P&gt;&lt;P&gt;Sum( { $ &amp;lt; LINE_CREATED_DATE = { "&amp;gt;=$(=Date(Start_date))&amp;lt;=$(=Date(End_date))" } &amp;gt;} cargo_volume)&lt;/P&gt;&lt;P&gt;Start_date and End_date are VARIABLES which take date entry from users.&lt;/P&gt;&lt;P&gt;(Variable video: &lt;A href="https://www.youtube.com/watch?v=uFT-PNf_z9g" target="_blank"&gt;https://www.youtube.com/watch?v=uFT-PNf_z9g&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;Date() turns date format into "mm/dd/yyyy"&lt;/P&gt;&lt;P&gt;After the LINE_CREATED_DATE column was converted into&amp;nbsp;"mm/dd/yyyy" format and the magic code works!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 20:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-range-in-set-analysis/m-p/1679199#M946536</guid>
      <dc:creator>usa_slin</dc:creator>
      <dc:date>2020-02-25T20:17:29Z</dc:date>
    </item>
  </channel>
</rss>

