The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
I have a requirement of subtracting months/years from the date to identify the previous date.
sgnarkhede2016
Member Posts: 152
Contributor II
Contributor II
in Help
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
0
Best Answer
-
You may also find the date manipulation functions in Generate Attributes operator helpful. In particular take a look at datediff() and datenow()
0
Answers
-
Hi @sgnarkhede2016,
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ésar0

Unicorn