Jump to content

Need help removing text from field


Pio Soto

This topic is 955 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

I'm using text in my delivery slip layout through a lookup field and want to remove text if "RO#" text is in the field

example: VS-321 The Severed Arm: Blu-Ray RO# 52975

i want to remove everything starting with "RO#" if the field contains it,

I know this can be done using LeftWords or RightWords but I can't get it done,

if anyone can help it would be much appreciated.

Thanks.

Pio

Link to comment
Share on other sites

Thank you, that works perfect when I use my data viewer to test it,

but how would I use it in my field if I already have a looked-up value selected

sorry I don't know how to do both I can either select calculation or looked-up in my options for field.

Link to comment
Share on other sites

You can incorporate a lookup in a calculation using the Lookup() function - say: 

Let ( [
text = Lookup ( Sourcetable::Sourcefield ) ;
pos = Position ( text ; " RO#" ; 1 ; 1 ) 
] ;
If ( pos ; Left ( text ; pos - 1 ) ; text )
)

This is assuming you need to have an independent copy of the looked up data, a copy that will not change if the lookup source field is modified. Otherwise you could simply use an unstored calculation field = 

Let ( [
pos = Position ( Sourcetable::Sourcefield ; " RO#" ; 1 ; 1 ) 
] ;
If ( pos ; Left ( Sourcetable::Sourcefield ; pos - 1 ) ; Sourcetable::Sourcefield )
)

 

Link to comment
Share on other sites

This topic is 955 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.