Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
sunilkumar6
Contributor
Contributor

How to calculate the Date field in between InDate and OutDate

Hi,

 I have below guest house highlighted field reg no,  Room no,  InDate,  out date and I want to calculate the Date field in between  InDate and outDate because I want to check the Room status any particular date. so How to calculate the Date field.  

Below are the sample Data.

 Eg: If I Select  Date 15-09-2017 so room no 110 Status  Should Show  OCCUPIED and if select  17-07-2017  than room Status should be UNOCCUPIED.

Reg noroom_noInDateoutDate
92240432811007-09-201716-09-2017
6010534811117-09-201718-09-2017
24073516811714-09-201721-09-2017
38090671811319-09-201730-09-2017
16053045610914-10-201718-10-2017
92240432811424-10-201726-10-2017
96196900811026-10-201726-10-2017
76181343611324-10-201727-10-2017
36076761010926-10-201727-10-2017
26010454610330-10-201730-10-2017
26010454610230-10-201731-10-2017
24073516810331-10-201701-11-2017
2005924211001-11-201703-11-2017
24073516811302-11-201704-11-2017

 

Labels (1)
4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Check this links.

https://community.qlik.com/t5/QlikView-Documents/Intervalmatch-example-with-dates/ta-p/1488212

https://community.qlik.com/t5/QlikView-Scripting/Interval-match-2-dates-and-a-range/td-p/594805

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
DM106
Contributor II
Contributor II

Hi Kaushik,

Qvw script which is marked as correct answer in the below link is not loading any data in Qliksense
https://community.qlik.com/t5/QlikView-Scripting/Interval-match-2-dates-and-a-range/td-p/59480

DM106
Contributor II
Contributor II

Can somebody please check this post and answer, I am curious to know the answer.

Lauri
Specialist
Specialist

How about you create an empty variable (let's call it PickDate), then insert a date picker object which stores your date selection in PickDate, and then add a Dimension column to your table:

=If($(PickDate)>=InDate and $(PickDate)<=OutDate, 'Occupied', 'Unoccupied')

Your table appears to have multiple rows per room, so you probably want to do some more calculations to get just one row per room, right?