ajnhlr Posted May 24, 2006 Posted May 24, 2006 Name & Parameters: [color:red][big] Default mail address ( ) [/big] Description: Sample Input: Results: Recursive: no Formula: I'm working on the following calculation. Case( Mail To = "Home"; Mailing Full Name & "¶" & Home Street & ¶ & Home City & "," & " "& Home State & " " & Home Zip Code; Mail To = "Work"; Mailing Full Name & Case(IsEmpty ( Title );""; ", " & Title) & Case(IsEmpty (Company) ; "";¶ & Company & ¶ & Work Street & ¶ & Work City & "," & " " & Work State & " " & Work Zip Code; Mail To ="Spouse Work"; Spouse Mailing Full Name & Case(IsEmpty ( Spouse Title );""; ", " & Spouse Title) & Case(IsEmpty ( Spouse Company ) ;"";¶ & Spouse Company) & ¶ & Spouse Work Street & ¶ & Spouse Work City & "," & " " & Spouse Work State & " " & Spouse Work Zip Code) Everything was working fine until I added the IsEmpty scenarios to Mail To = Work. When I copied and pasted Mail To = Spouse Work into Mail To = Work and changed the appropriate fields, Spouse Work returned nothing and Work returned: Name and a comma Title with a 0 I can't imagine that copying and pasting would change the values in Spouse Work and can't figure out why I'm not getting the correct results in Work. The results should be: Name, Title Company Street City, State Zip Code with Title and Company eliminated if nothing is entered in those fields and no blank line if Company is not entered. Thanks, ajnhlr FM Pro Advanced 8.3 Mac 10.4.6 Required Functions: Author(s): ajnhlr Date: 05/24/06 Credits: Disclaimer: FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.
John Mark Osborne Posted May 25, 2006 Posted May 25, 2006 Looks like you forgot a parenthesis when you were concatenating Company in the Work portion of your formula. Here's the entire formula: Case( Mail To = "Home"; Mailing Full Name & "¶" & Home Street & ¶ & Home City & "," & " "& Home State & " " & Home Zip Code; Mail To = "Work"; Mailing Full Name & Case(IsEmpty(Title); ""; ", " & Title) & Case(IsEmpty (Company) ; "";¶ & Company) & ¶ & Work Street & ¶ & Work City & "," & " " & Work State & " " & Work Zip Code; Mail To ="Spouse Work"; Spouse Mailing Full Name & Case(IsEmpty ( Spouse Title );""; ", " & Spouse Title) & Case(IsEmpty ( Spouse Company ) ;"";¶ & Spouse Company) & ¶ & Spouse Work Street & ¶ & Spouse Work City & "," & " " & Spouse Work State & " " & Spouse Work Zip Code)
LaRetta Posted May 25, 2006 Posted May 25, 2006 It would sure be easier overall if each person (and address) was a record instead of several fields. I would think you will run into many problems with this setup. Just a thought ... This doesn't need to be a Custom Function and I'll move it to Define Fields a bit later after ajnlhr reads it. :wink2:
ajnhlr Posted May 25, 2006 Author Posted May 25, 2006 Thanks. That works, except it leaves a blank line if Company doesn't have any data entered in it. Any suggestions?
John Mark Osborne Posted May 25, 2006 Posted May 25, 2006 I can't replicate the problem with the calculation I gave you. I removed the Company value and it works fine. Maybe you copied the formula incorrectly?
Lee Smith Posted May 26, 2006 Posted May 26, 2006 You want to use the Not with the isEmpty. I don't agree with your single field name, unless it is Concatenate Case(not IsEmpty(Name); Name) & " " & Case(not IsEmpty(Title); Title) & Case(not IsEmpty(Company); "¶" & Company) & Case(not IsEmpty(Street); "¶" & Street) & Case(not IsEmpty(City); "¶" & City) & Case(not IsEmpty(State); "¶" & State) & Case(not IsEmpty(Zip); "¶" & Zip) HTH Lee
Recommended Posts
This topic is 6758 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