Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
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?

balrajahlawat
Champion
Champion

Try this one:

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

Hope this will help!!

marcus_malinow
Specialist III
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.

kimrormark
Creator
Creator

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?

balrajahlawat
Champion
Champion

Try at script level