Pio Soto Posted October 25, 2020 Posted October 25, 2020 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
comment Posted October 25, 2020 Posted October 25, 2020 I would suggest: Let ( [ pos = Position ( text ; " RO#" ; 1 ; 1 ) ] ; If ( pos ; Left ( text ; pos - 1 ) ; text ) )
Pio Soto Posted October 25, 2020 Author Posted October 25, 2020 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.
comment Posted October 25, 2020 Posted October 25, 2020 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 ) )
Pio Soto Posted October 25, 2020 Author Posted October 25, 2020 Thank you!! and thanks for taking the time to help. It works perfectly. Pio
Pio Soto Posted October 26, 2020 Author Posted October 26, 2020 Hi, What if I wanted to remove the"C" or any letter from my field example of a field with a PO#: CG350C53 is there a way to remove the "C"s thanks. Pio
Recommended Posts
This topic is 1740 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 accountSign in
Already have an account? Sign in here.
Sign In Now