You can set the retention period for records based on the value in a tag column. You use a tag column if you archived records without a value, such as a date, that you can base the retention period on.
The following task flow explains how to use a tag column to set an expression-based retention period.
Add a tag column to the table that holds the transaction key.
Specify the Date data type for the tag.
Enter a date for the tag value.
For more information about adding a tag, see
Adding Tags.
Determine the database name of the tag.
Select
Data Discovery > Browse Data
.
Move all the
ilm_metafield#
columns from the
Available Columns
list to the
Display Columns
list.
Click
Search
.
Browse the results to determine the name of the tag column that contains the value you entered. For example, the name of the tag column is
Enter an expression such as the following sample expression in the
Expression
dialog box:
IFNULL(<name of the date column>, IFNULL(<name of the date tag column>, TODAY()))
For example, you set the retention policy to 10 years. You want to base the retention period on the last manufacturing date. If a record does not have the last manufacturing date, you want to base your retention period on the tag date. If a record does not have a tag date, you want to use today's date. Use the following expression:
In this example, the retention expiration date is set to 10 years after the last manufacturing date. If the record has a null value instead of a date in the last manufacturing date field, then the retention expiration date is set to 10 years after the date in the date tag column. If the record has a null value in the date tag column, the retention expiration date is set to 10 years after today's date.