Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
martin_hamilton
Creator
Creator

Create a new date column by adding months to a date

Hi

am looking to create a new field via a load script which looks at 2 fields.

the 2 field in question are:

Date | #ofMonths

01/01/16 | 12

The new column will add the 12 months to the current date.

i can do this in an expression in a KPI object but want to add in the load as a new column i.e. =AddMonths([Contract Start Date], [Contract Term])

Any help appreciated

1 Solution

Accepted Solutions
sunny_talwar

Are you looking to create 12 new rows or just one column which would tell you the Contract End Date? If you just want a single Contract End Date, then may be this:

LOAD [Contract Start Date],

          [Contract Term],

          Date(AddMonths([Contract Start Date], [Contract Term])) as [Contract End Date]

FROM....

View solution in original post

3 Replies
sunny_talwar

Are you looking to create 12 new rows or just one column which would tell you the Contract End Date? If you just want a single Contract End Date, then may be this:

LOAD [Contract Start Date],

          [Contract Term],

          Date(AddMonths([Contract Start Date], [Contract Term])) as [Contract End Date]

FROM....

martin_hamilton
Creator
Creator
Author

Hi

I figured this out myself in the end...

AddMonths([originaldate], [numberofmonths]) as [newdate]

martin_hamilton
Creator
Creator
Author

Thanks Sunny, I saw your response after i figured it out myself. I did however forget to format as a date so have added this in.

cheers