내 커뮤니티 업적 표시줄을 확대합니다.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.
해결됨

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.

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
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

원본 게시물의 솔루션 보기

2 답변 개

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

정확한 답변 작성자:
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