Expand my Community achievements bar.

SOLVED

adding dates in calculated field while ingestion

Avatar

Level 2

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 1

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

View solution in original post

2 Replies

Avatar

Community Advisor

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

Avatar

Correct answer by
Level 1

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