Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
anthony_kinsell
Creator
Creator

Looking for a formula re start / end dates

Hi,

I'm trying to work out a formula to calculate the vacant days on a given apartment. I have all the data I need (I think) in Qlikview - see table below:

UnitDescAptNoAptSeqAptSeq2TenNumTenStartDateTenStartDate1TenEndDateTenEndDate1Vacant Days
Apartment 1 101/1010 11013/09/20124116512/10/201341559
Apartment 1 101/1111 11113/10/20134156012/10/2014419240
Apartment 2 202/1212 21211/09/20124116329/08/201341515
Apartment 2 202/1313 21301/09/20134151831/08/2014418822
Apartment 3 303/1212 31201/07/20124109130/06/201341455
Apartment 3 303/1313 31301/07/20134145630/09/2013415470
Apartment 3 303/1414 31401/10/20134154830/09/2014419120
Apartment 4 404/1111 41131/08/20124115230/08/201341516
Apartment 4 404/1212 41231/08/20134151730/08/2014418810
Apartment 5 505/1313 51306/12/20124124905/12/201341613
Apartment 5 505/1414 51406/12/20134161405/12/2014419780
Apartment 101006/1414101406/10/20124118805/10/201341552
Apartment 101006/1515101506/10/20134155305/10/2014419170
Apartment 121207/1111121109/09/20124116108/09/201341525
Apartment 121207/1212121209/09/20134152631/05/2014417900

So basically what I'm trying to do is get a formula that will take the end date of 1 tenant from the start date of the next tenant. For example above on line 3 a tenant has moved out on the 29/08/13 & the new tenant moves in on the 01/09/13 (see line 4) therefore the vacant days is 2 i.e. the 30/08 & 31/08. The above is just a sample of the data - this will be done for over 50 apartments over a range of time. The vacant days above were just calculated in excel not in Qlikview.

Anyone got any idea how to do this?

13 Replies
MK_QSL
MVP
MVP

If you can upload sample file with only few data, better to answer, as from above script, it's difficult to work.

anthony_kinsell
Creator
Creator
Author

Manish,

See attached - appreciate the help.

The data should show the correct number of turnovers - i.e. tenants leaving or renewing. I have commented out what I tried to do based on your previous e-mails as it's not giving the correct results - obviously I'm doing something wrong.

Anthony

anthony_kinsell
Creator
Creator
Author

Manish

This may be a better qvw file to use as it lets you see the other data I am importing - I have just commented all out to only load the data we are looking at.

Anthony

anthony_kinsell
Creator
Creator
Author

Can nobody tell me how this can be done???