Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I'm having a heckuva time with this, and am hoping someone can lead me in the right direction.

I need to be able to remove everything in parentheses on the first line of an address. For example:

A-A ADL Transcription Services, Inc. (East Islip)

3132 Union Boulevard

East Islip, NY 11730

should display in another field as

A-A ADL Transcription Services, Inc.

3132 Union Boulevard

East Islip, NY 11730

The entire business name and address are contained in one field called Service_Address. I can't figure out how to write the calculation.

Thanks for any help you can provide.

Kevin

Posted

Someone's probably already made a function for this on briandunning.com, but here's a quick calc for ya:

Let([

  txt = yourAddressField ;

  par1 = Position ( txt ; "(" ; 1; 1 ) ; 

  par2 = Position ( txt ; ")" ; 1; 1 ) ; 



  result = Replace ( txt ; par1 ; par2-par1+1 ; "" )

  ];



  result 

 )

Posted

Tom, I just realized that there is one small flaw.

If the first line of the address does not contain parentheses, the calculation cuts off the first letter of the first line.

For example,

Aria Transcriptions

102 Sparrow Ridge Road

Carmel, NY 10512

becomes

ria Transcriptions

102 Sparrow Ridge Road

Carmel, NY 10512

Can the calculation be easily adjusted to ignore an address without parentheses?

Thanks again,

Kevin

Posted (edited)

Try =

Let ( [

line1 = GetValue ( Address ; 1 ) ;

start = Position ( line1 ; "(" ; 1 ; 1 ) ; 

end = Length ( line1 ) 

] ; 

Case ( start ;

Replace ( Address ; start ; end - start + 1 ; "" ) ;

Address

) 

)






Note:

This leaves in the character preceding the opening parenthesis. If you can be sure it's always a space or another punctuation mark, change the Replace() part to:




Replace ( Address ; start - 1 ; end - start + 2 ; "" ) ;

Edited by comment
Posted

Thank you, comment. Yes, it's always a space preceding the parenthesis. I used your calculation and changed the "Replace" line as suggested by you and it now works perfectly.

Thanks again, and have a nice weekend.

Kevin

This topic is 4887 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.