Newbies Henry Ammons Posted May 25, 2010 Newbies Posted May 25, 2010 Good day. I have searched for an answer to my question, but have come up short. I'm a novice FileMaker user and am trying to create a name calculation field. The calculation is composed of four fields: 1. First_Name 2. Last_Name 3. Alt_First_Name 4. Alt_Last_Name I'm trying to present names so that you get something like: If only one person is listed, it lists: First_Name Last_Name If two people are listed with the same name: First_Name "and" Alt_First_Name Last_Name If two people are listed with different last names: First_Name Last_Name "and" Alt_First_Name Alt_Last_Name So far my calculation is: If (Last_Name=Alt_Last_Name; First_Name & " and " & Alt_First_Name & " " & Last_Name; First_Name & " " & Last_Name & " and " & Alt_First_Name & " " & Alt_Last_Name) But it doesn't seem to work right. I always get an "and" even with one person listed, but no second person; otherwise it works. Any help is much appreciated! Thanks, Henry
Peter (duksis3) Posted May 25, 2010 Posted May 25, 2010 (edited) Hi, Need some more explanation - if there is 2 persons: you want to see both to choose witch one? Probably you can use portal Edited May 25, 2010 by Guest
Newbies Henry Ammons Posted May 25, 2010 Author Newbies Posted May 25, 2010 Thanks for your reply. Basically: John Doe (one person) John and Jane Doe (two people with the same last name) John Doe and Jane Smith (two people with different last names) Thanks!
Raybaudi Posted May 25, 2010 Posted May 25, 2010 Hi try this: Let([ A = ValueCount ( List ( First_Name ; Last_Name ) ) ; B = ValueCount ( List ( Alt_First_Name ; Alt_Last_Name ) ) ]; Case( A + B = 4 and Last_Name = Alt_Last_Name ; First_Name & " and " & Alt_First_Name & " " & Last_Name ; A + B = 4 ; First_Name & " " & Last_Name & " and " & Alt_First_Name & " " & Alt_Last_Name ; A = 2 ; First_Name & " " & Last_Name ; B = 2 ; Alt_First_Name & " " & Alt_Last_Name ; ) )
Newbies Henry Ammons Posted June 2, 2010 Author Newbies Posted June 2, 2010 That worked perfectly! Thank you so much. I have a lot to learn and try to solve these things on my own, but really appreciate the help. Sincerely, Henry
Recommended Posts
This topic is 5346 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