# LAST() function
Updated: 10/14/2021, 2:20:00 PM
Created: 10/14/2021, 2:20:00 PM
Last Updated By: mikes
Read Time: 1 minute(s)
The LAST() function retrieves the last delimited element of a string. The delimiter can be any character.
It takes the general form:
- expression evaluates to the string to be processed.
- delimiter is optional and can be any character. If not specifed then @AM is used and is the default character. If there is no @AM then @VM is used. If there is no @VM then @SVM is used.
This function can only be use in A; conversions/correlatives or in I-types.
# Examples used with A; conversions or correlatives
If attribute 6 contains any @VMs then the last multi-value is returned. If there are no @VMs then the last sub-value is returned.
Returns the last comma-delimited element from attribute 6.
# I-type examples
Returns the last attribute from the record. This is the same as LAST(@RECORD, @AM)
If attribute 1 contains any @VMs then the last multi-value is returned. If there are no @VMs then the last sub-value is returned.
Returns the last sub-value from the 6th multi-value in attribute 3.
Returns the last tab-delimited element from attribute 2.
Back to Correlative Processing