<?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: Including days between 2 dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260616#M1189005</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan, thanks for the model. It works perfectly. My next step would be to query the result from this text box. Alternatively can i make use of the formula in an expression, whereby I need to say that the check_in is between =concat(Date(ValueLoop(check_in+1,check_out-1,1)),',',). Is this possible? Sorry for bugging you. Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Aug 2011 12:49:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-08-10T12:49:24Z</dc:date>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260609#M1188998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; Hi All, I'm relatively new to Qlikview. I've got a table that has data populated by date. I need to extract the dates for the dates between the check_in and check_out columns. How would one go about doing this. Below is the code for the table in question:&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;[SURVEY RESPONDENTS]:&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; SELECT agent as "Agent",&lt;BR /&gt; annivesary as "Anniversary",&lt;BR /&gt; "batch_number",&lt;BR /&gt; bookingsource as "Booking Source",&lt;BR /&gt; "check_in" as "Check In",&lt;BR /&gt; "check_out" as "Check Out",&lt;BR /&gt; Datediff(DD,check_in,check_out) as "No. of Days Spent",&lt;BR /&gt; Year(check_in) as Years,&lt;BR /&gt; Month(check_in) as Month,&lt;BR /&gt; Day(check_in) as Day,&lt;BR /&gt; "client_email" as "Guest E-mail",&lt;BR /&gt; "client_id" as "Client ID",&lt;BR /&gt; "client_title" as "Guest Title",&lt;BR /&gt; clientprofileid,&lt;BR /&gt; company as "Guest Company",&lt;BR /&gt; completed as "Completed",&lt;BR /&gt; country as "Country",&lt;BR /&gt; "currency" as " Currency",&lt;BR /&gt; "date_completed" as "Date Survey Completed",&lt;BR /&gt; "date_entered" as "Guest Date Entered",&lt;BR /&gt; dateofbirth as "Date of Birth",&lt;BR /&gt; "email_sent" as " E-Mail Sent",&lt;BR /&gt; "first_name" as "First Name",&lt;BR /&gt; "global_client_id",&lt;BR /&gt; "last_name" as "Surname",&lt;BR /&gt; "first_name" +' '+ "last_name" as "Guest Name",&lt;BR /&gt; loyaltynumber as "Loyalty Number",&lt;BR /&gt; loyaltytype as "Loyalty Type",&lt;BR /&gt; mealplan as "Meal Plan",&lt;BR /&gt; mobile as "Mobile",&lt;BR /&gt; "phone_number" as "Phone Number",&lt;BR /&gt; "property_id" as "Property ID",&lt;BR /&gt; rate as "Amt Paid(KSH)",&lt;BR /&gt; "reservation_id" as "Reservation ID",&lt;BR /&gt; "room_number" as "Room Number",&lt;BR /&gt; "room_type" as "Room Type",&lt;BR /&gt; VIP&lt;BR /&gt; FROM "Guest".dbo."survey_respondents"; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 14:34:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260609#M1188998</guid>
      <dc:creator />
      <dc:date>2011-08-09T14:34:54Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260610#M1188999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you after number of days between the two in which case you can either do Check_In-Check_Out or if looking for number of working days NetworkDays(Check_In,Check_Out)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 15:19:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260610#M1188999</guid>
      <dc:creator />
      <dc:date>2011-08-09T15:19:09Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260611#M1189000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There, thanks for the prompt feedback. What I'm actually looking for is the actual dates between the check_in and check_out columns. Example check_in is 2011/08/01 and check_out is 2011/08/05. The result of the function should display 2011/08/02, 2011/08/03, 2011/08/04. Is this possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 19:33:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260611#M1189000</guid>
      <dc:creator />
      <dc:date>2011-08-09T19:33:53Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260612#M1189001</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;maybe your looking for something like:&lt;/P&gt;&lt;P&gt;=concat(Date(ValueLoop(check_in,check_out,1)),',',)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where check_in and check_out should be numerical / dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just see that you want only the dates inbetween, could be:&lt;/P&gt;&lt;P&gt;=concat(Date(ValueLoop(check_in+1,check_out-1,1)),',',)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but haven't tested (and tried if dates are the same or sequential).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 23:29:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260612#M1189001</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-09T23:29:26Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260613#M1189002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aargh, I just tried if start&amp;gt;end of valueloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Won't handle properly, better to check and take care of before calling the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 23:33:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260613#M1189002</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-09T23:33:29Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260614#M1189003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan, thanks for the feedback. But it still does not work. Any other suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 11:43:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260614#M1189003</guid>
      <dc:creator />
      <dc:date>2011-08-10T11:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260615#M1189004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please have a look at my attached document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on your requirements, it may work as shown. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 12:01:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260615#M1189004</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-10T12:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260616#M1189005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan, thanks for the model. It works perfectly. My next step would be to query the result from this text box. Alternatively can i make use of the formula in an expression, whereby I need to say that the check_in is between =concat(Date(ValueLoop(check_in+1,check_out-1,1)),',',). Is this possible? Sorry for bugging you. Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 12:49:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260616#M1189005</guid>
      <dc:creator />
      <dc:date>2011-08-10T12:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260617#M1189006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The valueloop functions seems to have some severe limitations for use under normal conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you could describe what you want to achieve, what your business case is? There might be a better, simpler solution then. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not understand your last requirement, where the check_on is between the date list?&amp;nbsp; Could you give an example, please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 12:56:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260617#M1189006</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-10T12:56:43Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260618#M1189007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take a resident of table and &lt;/P&gt;&lt;P&gt;in resident &lt;/P&gt;&lt;P&gt;write &lt;/P&gt;&lt;P&gt;( check_in-check_out) as [No. of Days Spent]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 13:02:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260618#M1189007</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2011-08-10T13:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260619#M1189008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan, i need to compute statistics for a hospitality. Whereby they supply us with check_in and check_out dates. Example check_in :2011/07/01&amp;nbsp;&amp;nbsp; check_out:2011/07/06&amp;nbsp;&amp;nbsp; So a guest could of had checked in on the 2011/06/30 and check out on 2011/07/03. This guest should be included in my calculation for occupancy for a day(in this case the 2011/07/02). So if i just make use of check_in and check_out dates, this guest will not be featured in the calculation. Whereas if a take the dates between the check_in and check_out columns, the calculation would work perfectly.In SQL i can do this by the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---ONCE OFF&lt;BR /&gt;CREATE FUNCTION GET_TIMESTAMP(@DT DATETIME)&lt;BR /&gt;RETURNS INT&lt;BR /&gt;AS&lt;BR /&gt;BEGIN&lt;BR /&gt;RETURN DATEDIFF( S, '19700101', @DT );&lt;BR /&gt;END&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;---this is the correct script&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM dbo.survey_respondents&lt;BR /&gt;WHERE&lt;BR /&gt;dbo.GET_TIMESTAMP(check_in) between dbo.GET_TIMESTAMP('2011/07/01') and dbo.GET_TIMESTAMP('2011/07/06')&lt;BR /&gt;OR dbo.GET_TIMESTAMP(check_out) between dbo.GET_TIMESTAMP('2011/07/01') and dbo.GET_TIMESTAMP('2011/07/06') &lt;BR /&gt;ORDER BY check_in ASC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---Incorrect Script that excludes the guest that checkin on the 2011/06/30 and checkout on the 2011/07/03&lt;/P&gt;&lt;P&gt;select *&lt;BR /&gt;from survey_respondents&lt;BR /&gt;where convert(varchar,check_in,111) = '2011/07/01' &lt;BR /&gt;and CONVERT(varchar,check_out,111) = '2011/07/06'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 13:12:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260619#M1189008</guid>
      <dc:creator />
      <dc:date>2011-08-10T13:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260620#M1189009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this case, I would just compare the actual date 2011/07/02 with the check_in and check_out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example sum all guests for a given actual_date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(if(actual_date &amp;lt;= check_out and actual_date&amp;nbsp; &amp;gt;= check_in, 1,0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this sound feasible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 13:20:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260620#M1189009</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-10T13:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260621#M1189010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan, sorry for the late response. The above mentioned does not work, but if i could write the syntax that would say :&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check In]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; IN (concat(Date(ValueLoop(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check In]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+1,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check Out]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-1,1)),',',)),1,0))&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 8pt;"&gt;This might work, but how does one write an IN statement in QlikView?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 08:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260621#M1189010</guid>
      <dc:creator />
      <dc:date>2011-08-11T08:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260622#M1189011</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 am a bit confused:&lt;/P&gt;&lt;P&gt;the value loop will return values for the time period inbetween Check in and check out, but excluding the both dates.&lt;/P&gt;&lt;P&gt;So check in date will never be part of that list, right? As I read it, that's what your if() is checking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be easiest if you could post a small app here (upload available in advance editor), so someone could work with you on your data (could be sample data, no need for your real customer data, of course).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I understood, you have a calendar, and check in dates and check out dates. For a given date of the calendar (or some other event date, like "SpecialOfferDate"), you would like to check if a customer was checked in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in the table, I would still try customer as dimension and then as only expression (for example new years day):&lt;/P&gt;&lt;P&gt;=if(check_in &amp;lt;= '01/01/2011' and check_out &amp;gt;= '01/01/2011',1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that rows with zero values are&amp;nbsp; not shown, you should get a table with all customers that stayed around new year 2011.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(hadling dates might be a bit tricky though, you have to take care that date formats exactely match when comparing values, or use numerical representation instead).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. Back to the valueloop thing, I think it will not work in a table context, only if you have limited your selection to one check_in / check_out pair. valueLoop is not really made for things like that. So I haven't followed that idea further&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edited by swuehl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 22:43:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260622#M1189011</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-11T22:43:47Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260623#M1189012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan, my apologies for the late reply, was off for a couple of days. Anyway i tried using the following formula &lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check In]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check Out]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check Out]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check In]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Guest Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;but it does not work. If i selected as my check-in 2011/08/01 and check-out 2011/08/10. the result is only guests whom have checked in for those dates, and not the dates between check-in and check-out. Any suggestions on this one?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 10:53:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260623#M1189012</guid>
      <dc:creator />
      <dc:date>2011-08-15T10:53:47Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260624#M1189013</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 assume your above if condition is always true, since your checking (twice) if check in date is prior or equal check out date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's not what you want. You need a date field with values for all dates within the period you are interested in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you currently only have check in and check out dates, create a master calendar (search the forum, there are lot of threads and example apps).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This master calendar could not be associated to other tables, just for time period selection.&lt;/P&gt;&lt;P&gt;Then you could use&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check In]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt;= min(MasterDate)&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Check Out]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;= max(MasterDate)&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Guest Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your master calendar is associated to your check in and check out dates, above will probably not work, you might need a set expression:&lt;/P&gt;&lt;P&gt;= count({&amp;lt;[Check In]= {"&amp;gt;=$(=min(MasterDate))"}, [Check Out]={"&amp;lt;=$(=max(MasterDate))"} &amp;gt;} [Guest Name])&lt;/P&gt;&lt;P&gt;to count all Guests with a visit in the selected period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. If you could post a sample app here, I think that could ease helping you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 11:56:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260624#M1189013</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-15T11:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260625#M1189014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan, thanks again for the assistance. I did as you suggested above, but i think somewhere in my linking the calender to my data, something went wrong. Because I get the correct total number of guests,but when clicking on any chart, the data is horribly wrong. I've attached a sample copy of the model(no calender links in this one), can you kindly guide me to the correct way of displaying the data with the check_in and check_out in mind. The attached version when you open it has filters on it, basically for 2011 year, the 7th month, and check_in and check_out days from the 1st to the 7th. The result of the total Guests should be 1202 and not 3 as displayed in the model. Can you guide me to how this will be made possible. PS : I've removed my incorrect calender settings and reverted it back to the original state. Thanks again for all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 11:28:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260625#M1189014</guid>
      <dc:creator />
      <dc:date>2011-08-16T11:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260626#M1189015</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 tried to create a sample app, please see attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In tab Proposal, you will see that I selected Jul 2011 in the calendar (I replaced all Date objects with calendar date objects. I noticed, that in your original version, you had kind of mix between check In and check out dates when creating Month and year, I think you should remove these fields or name them explicitely as check_out_Month etc.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For July 2011, I get 1202 guests staying at one of the hotels, totalling 3066 days of visit. Please note, that I included check_in and check_out day&amp;nbsp; in my calculation for visit days, where e.g. the field no. of days spent is calculated as check_out - check_in Date, resulting in zero days if the dates are the same and one day if check_out is the day after check_in (where I count these visits as 1 resp 2 days.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your original version, you got 3 guests, but you selected explicitely check_in on July 1st and check_out July 7th, which is not giving what you intended, I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So please have a look at my proposal, I can explain some more, if needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Aug 2011 21:37:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260626#M1189015</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-08-21T21:37:06Z</dc:date>
    </item>
    <item>
      <title>Including days between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260627#M1189016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan, It is working quite well now. Thanks for all your assistance, it's duly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 13:11:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Including-days-between-2-dates/m-p/260627#M1189016</guid>
      <dc:creator />
      <dc:date>2011-08-22T13:11:28Z</dc:date>
    </item>
  </channel>
</rss>

