· Feb 25, 2021

How to use lookup function ignoring first 4 chars and do the match


I am using below function and it works fine but i want to match the value ignoring the first 4 chars as they are only added to sort the data.


For example

My table has following values




w ^Ens.LookupTable("EMRName","0002EMRNameA") this works 

But i want to use something like that

w ^(Ens.LookupTable("EMRName","%EMRNameA") this doesnt works 

Discussion (3)2
Log in or sign up to continue

You can extract the values you want using $EXTRACT (or $E for short) where * represents the length of your string:

Set tValue = "0003EMRNameC"
Set tValueToLookup = $EXTRACT(tValue,5,*)

You should be able to put it on within the single function call if you prefer as well, but that's up to you.