TRUNCATE function


The TRUNCATE function allows you to truncate characters from either the start or end points of your data. You may optionally add a period or ellipsis to the truncated data. The TRUNCATE function is similar to the LEFT and RIGHT functions.


TRUNCATE ( text, number , position , style )


text The data to be manipulated. text vector
number The number of characters to return (the rest of the characters are removed). number vector
position Optional: indicate whether to truncate the end (default) or the start of the data, or to split the data. selectable option vector

Optional: add either a blank (default), a period or an ellipsis to the truncated result. If this parameter is specified, the position parameter must also be specified.

selectable option vector




TRUNCATE ( A:A , 3 ) returns [Jan, Feb, Mar]

TRUNCATE ( A:A , 3 , end , period ) returns [Jan., Feb., Mar.]

TRUNCATE ( A:A , 3, start ) returns [ary, ary, rch]

TRUNCATE ( A:A , 3, split ) returns [Jay, Fey, Mah]

TRUNCATE ( A:A , 4, split ) returns [Jary, Fery, Mach]

Related links: