I have a requirement of subtracting months/years from the date to identify the previous date.
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
-
Telcontar120 RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 UnicornYou may also find the date manipulation functions in Generate Attributes operator helpful. In particular take a look at datediff() and datenow()
0
Answers
Do you need to subtract a fixed number of days or depends on the month? If it depends on month, a good idea is to identify the month and then subtract the specific number of days
check this thread, for that.
How to calculate no of day's present in month based on given date — RapidMiner Community
Best
César