I have a requirement of subtracting months/years from the date to identify the previous date.

sgnarkhede2016
sgnarkhede2016 New Altair Community Member
edited November 2024 in Community Q&A

I have a requirement of subtracting months/years from the date to identify the previous date. Following is the implementation that I have done to achieve that:

1. Generate Attribute operator is used to get the PREVIOUS date:

1st Example:

PREVIOUS_DATE = date_add(date_parse_custom(ACCOUNT_INFO_DATE,"MM/dd/yyyy"),-1,DATE_UNIT_MONTH)

ACCOUNT_INFO_DATE consist of nominal date which is in "MM/dd/yyyy" format

Example:

ACCOUNT_INFO_DATE = 04/30/2021

PREVIOUS_DATE = 03/30/2021

Ideally, It should be 03/31/2021 as we are subtracting 1 month from the date.

I have attached the process for reference that I am trying


Thanks in advance

Tagged:

Best Answer

  • Telcontar120
    Telcontar120 New Altair Community Member
    Answer ✓
    You may also find the date manipulation functions in Generate Attributes operator helpful. In particular take a look at datediff() and datenow()

Answers