Question
Gigi Hoffpauir · Jul 11, 2018

extracting substring from variable length string

I am working in Ensemble (Health Connect) and doing an HL7 translation

I have what I hope is a simple coding question (but for the life of me, I am struggling).  I have a requirement where I need to extract the last 5 characters of a variable length string.  The return value should be those last 5 characters.  For example - String = CE325ACCT98765 where the return value of the function needs to be 98765.  I am just drawing a blank.

thank you,

Gigi

0
0 337
Discussion (1)1
Log in or sign up to continue

$EXTRACT(string,*-4,*)
should do it .  * marks the last char in the string

*-4 ist he first of the last five chars