adding dates in calculated field while ingestion | Community
Skip to main content
Level 2
June 27, 2024
Solved

adding dates in calculated field while ingestion

  • June 27, 2024
  • 2 replies
  • 779 views

We have two fields one contains a date and one contains a number of days an integer. So we want to add the number of days in the current date and create a new one. 
Example :

Date : 6/27/2024

AddDays: 10

output we want 7/7/2024
Please tell how can I implement this in calculated field.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by KyleVF7

I have done something similar but for years. On ingestion I used set_date_part("yyyy",to_integer(split(warrantyDate,"/")[2])+WarrantyLength,date(warrantyDate, "M/d/yyyy")) to add the warrantyLength int to the year from warrantyDate.

Example:

WarrantyDate = "01/01/2024"

WarrantyLength = 2

the returned value would be 01/01/2026

2 replies

arpan-garg
Community Advisor
Community Advisor
July 11, 2024

Hi @vs1985  - I don't think there is a data prep function available for this, you would have to do it in the source system ingesting the data.

 

Thanks,

Arpan

KyleVF7
KyleVF7Accepted solution
August 21, 2024

I have done something similar but for years. On ingestion I used set_date_part("yyyy",to_integer(split(warrantyDate,"/")[2])+WarrantyLength,date(warrantyDate, "M/d/yyyy")) to add the warrantyLength int to the year from warrantyDate.

Example:

WarrantyDate = "01/01/2024"

WarrantyLength = 2

the returned value would be 01/01/2026