Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to determine End_date from Start_date

Hi Guys,

Please can any one help me to determine the end date of a contract from the start date? I only have the contract period in numbers such as a two year contract beginning 1/1/2015 has a contract period 24.See example below. So Please how can I determine the end date with thesame format as the start date in a Table in Qlikview based on the Contract_Period@@?

ID          Start_date               End_date                    Contract_period                        E.g End_date

1            1/1/2015                    ?                                      24                                       12/31/2016

2             2/10/2015                  ?                                       24                   

3             5/15/2015                   ?                                       24

4              6/10/2015                   ?                                       24

5               7/20/2015                    ?                                       24

Note: Date Format is "MM/DD/YYYY"

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Maybe

Date(AddMonths(Start_date,Contract_Period),'MM/DD/YYYY')

View solution in original post

15 Replies
Clever_Anjos
Employee
Employee

Maybe

Date(AddMonths(Start_date,Contract_Period),'MM/DD/YYYY')

Not applicable
Author

Hi Clever, I added the statement to the Calendar script but it did not work.

Clever_Anjos
Employee
Employee

Would you mind sharing your data or sample of your app?

Anonymous
Not applicable
Author

Try this one:

date(AddMonths(date(StartDate,'DD/MM/YYYY'),ContractPeriod),'DD/MM/YYYY') as EndDate

Hope this will help!!

marcus_malinow
Partner - Specialist III
Partner - Specialist III

how about

Date(AddMonths(date(StartDate, 'MM/DD/YYYY'), ContractPeriod) - 1, 'MM/DD/YYYY')

Not applicable
Author

Bu the problem is the Startdate and Contract Period reside in two different table. So using the Resident function it give me an error saying the contract period cannot be found.

Anonymous
Not applicable
Author

Don't do the above in the calendar script, but in the actual table with the data.

Not applicable
Author

So Kim Should I add as an expression?

Anonymous
Not applicable
Author

Try at script level