Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Field Calculation


Hi All

I would like to have a field that automatically calculates a date based on the amount of years in the [Years] field.

e.g 18/09/2014 + 2 years (I want the result to be in a date format dd/mm/yyyy). How can I do this?

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You can use function AddYears:

AddYears(YourDateField, NumOfYears)

View solution in original post

4 Replies
Anonymous
Not applicable
Author

You can use function AddYears:

AddYears(YourDateField, NumOfYears)

rubenmarin
MVP
MVP

Hi Tumelo, cCan you try?:

AddMonths(DateField, YearsField * 12)

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

LOAD

*,

AddYears(DateFieldName, YearsFieldName) AS NewDate

FROM DataSource;


Regards,

Jagan.

Not applicable
Author

Hi All. Thanks a lot for replies, very helpful indeed. All Answers are correct. Pitty we can only mark one... 🙂