Options

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

sgnarkhede2016sgnarkhede2016 Member Posts: 152 Contributor II

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

Best Answer

  • Options
    Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Solution Accepted
    You may also find the date manipulation functions in Generate Attributes operator helpful. In particular take a look at datediff() and datenow()

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts

Answers

Sign In or Register to comment.