<?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: dates range in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195643#M878997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you were looking to get?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/140749_Capture.PNG" style="height: 322px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for each hour, the expression is summing the last seven day for that particular hour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So 2016-08-01 Hour 0 will sum 7 days hour 0 numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=RangeSum(Above(TOTAL Count({&amp;lt;[Fiscal Month], [Fiscal Period], [Fiscal Quarter], [Fiscal Year], [Fiscal Year Month], [Fiscal Year Name], [Fiscal Year Quarter], [Month Name], [Month Year], [Month Year Previous]&amp;gt;} Patient), 0, 7)) * Avg(1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to ignore any date and time related field where you might be making selections. I have added few of them, but you may not need them all if you don't plan to make selection in them. An alternate approach would be to use &lt;A href="https://community.qlik.com/qlik-blogpost/4531"&gt;The As-Of Table&lt;/A&gt;‌. This is fairly robust approach and I would recommend looking into this if you have no issue making changes in your script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Oct 2016 22:18:30 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-10-15T22:18:30Z</dc:date>
    <item>
      <title>dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195640#M878994</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 have a pivot table with Date as my dimension.&lt;/P&gt;&lt;P&gt;I would like it to calculate based on each Date record in my dimension in my pivot table…&lt;/P&gt;&lt;P&gt;So for example rows in my pivot table look like:&lt;/P&gt;&lt;P&gt;Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count&lt;/P&gt;&lt;P&gt;2016-08-01,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (count aggregated from 2016-7-25 to 2016-08-01)&lt;/P&gt;&lt;P&gt;2016-08-02,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (count aggregated&amp;nbsp; from 2016-7-26 to 2016-08-02)&lt;/P&gt;&lt;P&gt;2016-08-03,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (count aggregated from 2016-7-27 to 2016-08-03)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know how I should create my expression using set analysis. I tried different things like 'Count( {$&amp;lt; Date = {‘&amp;gt;=$(=max(Date)-7)&amp;lt;=$(=max(Date))’} , Date =&amp;gt;} Field1)'. But nothing worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank yo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195640#M878994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195641#M878995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis won't work on row by row basis. You will need to use Aggr function here or may be you need to use RangeSum() with Above() function. Can you share some sample with expected output to help you better?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 17:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195641#M878995</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-13T17:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195642#M878996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks Sunny! Attached is my sample. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;i'm creating an hourly census, but for each day i want it to only look at the range from 7 days before to current. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;So for Aug 01 2016 I only want to calculate the count between 07-252016 to 08-01-2016 instead of all the dates in my data. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Please take a look and let me know.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;thank you! !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Oct 2016 00:19:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195642#M878996</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-15T00:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195643#M878997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you were looking to get?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/140749_Capture.PNG" style="height: 322px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for each hour, the expression is summing the last seven day for that particular hour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So 2016-08-01 Hour 0 will sum 7 days hour 0 numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=RangeSum(Above(TOTAL Count({&amp;lt;[Fiscal Month], [Fiscal Period], [Fiscal Quarter], [Fiscal Year], [Fiscal Year Month], [Fiscal Year Name], [Fiscal Year Quarter], [Month Name], [Month Year], [Month Year Previous]&amp;gt;} Patient), 0, 7)) * Avg(1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to ignore any date and time related field where you might be making selections. I have added few of them, but you may not need them all if you don't plan to make selection in them. An alternate approach would be to use &lt;A href="https://community.qlik.com/qlik-blogpost/4531"&gt;The As-Of Table&lt;/A&gt;‌. This is fairly robust approach and I would recommend looking into this if you have no issue making changes in your script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Oct 2016 22:18:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195643#M878997</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-15T22:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195644#M878998</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;Thanks a lot for looking into this and provide the solution.&lt;/P&gt;&lt;P&gt;But this is not what i was looking for. Let me provide some background of what i'm trying to achieve.&lt;/P&gt;&lt;P&gt;So this table is a patient census table, basically it's looking at every day at each hour, how many patients are there in &lt;/P&gt;&lt;P&gt;the ER room. So if a patient come in July 31 20:00 pm and leave Aug 01 02:00 am, he would be counted at below hours: July 31 20:00, July 31 21:00, July 31 22:00, July 31 23:00, Aug 01 00:00, Aug 01 01:00, Aug 01 02:00 those 7 buckets. I have already done that part. But because there is very occassionally some outlier data, for example, there could be a patient whose leaving date is more than 100 later than the coming date which is not possible. Those are wrong data. So what I want to do in set analysis is that at any point of time, a patient is only counted if the entering date is less than 7 days before. &lt;/P&gt;&lt;P&gt;Hope that explained the purpose of my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for providing insight, it's very helpful. Especially i'm interested to know more about As-Of Table.&lt;/P&gt;&lt;P&gt;And if you have a solution to my elaborated problem, please let me know. Highly appreciate your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LeeAnn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Oct 2016 00:24:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195644#M878998</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-16T00:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195645#M878999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share an example where you are seeing this? I am seeing a max duration on 40 hours within the sample. May be if I can see the issue, I might be able to provide a solution for it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/140788_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Oct 2016 22:11:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195645#M878999</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-16T22:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195646#M879000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Sunny, &lt;/P&gt;&lt;P&gt;here is an example, so for Aug 01-2016 hour 0 the count is 46, the correct count should be 45.&lt;/P&gt;&lt;P&gt;Reason for that is there is an abnormal record with Patient Id : 2265638 which is registered more than a week ago prior to Aug 01 2016.&lt;/P&gt;&lt;P&gt;So in my example I want to ignore records like that but i don't know how i can specify that in set analysis.&lt;/P&gt;&lt;P&gt;I don't want my count take into account of those records that's registered in the ER more than 7 days before. Only the ones within 7 days period.&lt;/P&gt;&lt;P&gt;How can I do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 00:00:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195646#M879000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-17T00:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195647#M879001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(Aggr(If(Count(Total &amp;lt;Patient&amp;gt; FullDate) &amp;lt;= 7, Patient), FullDate, &lt;STRONG style="font-size: 13.3333px;"&gt;Day, Hour, &lt;/STRONG&gt;Patient))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/140885_Capture.PNG" style="height: auto;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is completely ignoring any record which has entries for more than 7 days. In case you want to see them for only 7 days, then you can try this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(Aggr(If(Min(Total &amp;lt;Patient&amp;gt; FullDate) + 7 &amp;gt; FullDate, Patient), FullDate, Day, Hour, Patient))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 17:58:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195647#M879001</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-17T17:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195648#M879002</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;Thanks a lot! this seems to work. Only that I need hours to be from 0 to 23 and I didn't load all hours in my previous example out of laziness (sorry about that). And I found this solution only works for hour 0.&lt;/P&gt;&lt;P&gt;How can i modify my expression so that it works for all 24 hours in a day?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see attached example after expanded the hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;LeeAnn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 19:08:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195648#M879002</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-17T19:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195649#M879003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I updated the expression in my post, but forgot to fix it in the attached application. Try this where we have all dimensions from the chart in the Aggr() function here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(Aggr(If(Count(Total &amp;lt;Patient&amp;gt; FullDate) &amp;lt;= 7, Patient), FullDate,&lt;SPAN style="color: #ff0000;"&gt; Day, Hour,&lt;/SPAN&gt; Patient))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/140905_Capture.PNG" style="height: 326px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2016 20:06:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195649#M879003</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-17T20:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195650#M879004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Sunny! can you please explain how it works? &lt;/P&gt;&lt;P&gt;In the example it worked fine for certain cell but not all. So in the example, i only inserted one error record where it's registered more than 7 days before. So the final result compare to previous count should be 1 count less in each hour for each day. Although i have seen many cells turn to be more counts less which shouldn't be the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But thank you so much for helping me along the way!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 00:44:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195650#M879004</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-18T00:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195651#M879005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, this isn't working perfectly in all cases? May be if you can point out those places where it doesn't work, we might be able to take a look at this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now that I am looking at this, the expression might need a DISTINCT in there to work&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Count(Aggr(If(Count(&lt;SPAN style="color: #ff0000;"&gt;DISTINCT&lt;/SPAN&gt; Total &amp;lt;Patient&amp;gt; FullDate) &amp;lt;= 7, Patient), FullDate, &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;Day, Hour,&lt;/SPAN&gt; Patient))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you check if that resolves all your issues. I can go over the details of what this expression is doing in my next response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 02:51:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195651#M879005</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-18T02:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195652#M879006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny, but that expression doesn't really work still. In my example, my data represents from time of patients going into emergency room&lt;SPAN style="font-size: 13.3333px;"&gt;(registration) to when they leave (disposition). So normally duration of patient in ER won't be longer than 7 days. So&lt;/SPAN&gt; i added 1 abnorrnal record:&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;Patient Id : 2265638 where it's registered in 2015 and disposed in 2016, this is an error. My purpose is that i need to implement the logic so that this abnormal record is filtered out in chart, so the end result will be only 1 count less for every day every hour than if it were not filtered out.&lt;/SPAN&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;BR /&gt;&lt;/SPAN&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;Not sure if i'm explained what i was trying to do.&lt;/SPAN&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;BR /&gt;&lt;/SPAN&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;Please let me know.&lt;/SPAN&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;Thanks!&lt;/SPAN&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;LeeAnn&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:02:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195652#M879006</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-19T00:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195653#M879007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But isn't that what it did in the example where you added that patient id: 2265638? it counted one less patient? I think your last sample did not include 2265638, that is why we don't see any difference, but if it was there we would have seen one less patient&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/141170_Capture.PNG" style="height: 262px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 08:51:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195653#M879007</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-19T08:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195654#M879008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Sunny!!... i added the patient 2265638 in to my sample... please see attached...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:47:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195654#M879008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-19T17:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195655#M879009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made a slight change, may be this is what was causing the issue:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(Aggr(If(Count(&lt;SPAN style="color: #ff0000;"&gt;{1}&lt;/SPAN&gt;Total &amp;lt;Patient&amp;gt; FullDate) &amp;lt;= 7, Patient), FullDate, Day, Hour, Patient))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 19:05:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195655#M879009</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-19T19:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195656#M879010</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;I used your last expression, still didn't work. &lt;/P&gt;&lt;P&gt;I inserted one wrong record and my expected result is that the count in Before column is always 1 count more than the After Column.&lt;/P&gt;&lt;P&gt;Currently it's variant and i'm not sure what the expression is doing: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="image.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/141277_image.PNG" style="height: 327px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;LeeAnn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 19:58:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195656#M879010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-19T19:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195657#M879011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I am not sure what exactly isn't working. If we can drill down to a very specific range of data and if you can explain what isn't matching, I might be able to help. I am sorry, I have not been very helpful thus far, but I am not sure what exactly is missing &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other alternative would be to&amp;nbsp; wait for someone else to respond &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 20:18:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195657#M879011</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-19T20:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: dates range in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195658#M879012</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;No worries, thanks very much for the help along the way!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LeeAnn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2016 17:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/dates-range-in-set-analysis/m-p/1195658#M879012</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-20T17:55:29Z</dc:date>
    </item>
  </channel>
</rss>

