Slobey Posted August 26, 2005 Posted August 26, 2005 Hi gang, I am trying to make a calculation field that will show initials. If a record has a single person, its easy, I just use the left function for the first name and last name. The problem I have is the record has 2 people Only the first name field is populated with an &. for example Terry & Archie. so I tried the following calc. It doesn't work, it only shows "T". What am I missing? why doesn't this work? It is probably something obvious but it is driving me nuts. Case( PatternCount ( Splicer::Name First ; "&" ); Left (Splicer::Name First; 1 ) & Left (RightWords (Splicer::Name First ; 1 ); 1 ); Left (Splicer::Name First; 1 ) & Left (Splicer::Name Last; 1 ) ) Thanks in advance
RalphL Posted August 26, 2005 Posted August 26, 2005 Case( PatternCount ( Splicer::Name First ; "&" ); Left (Splicer::Name First; 1 ) & Left (RightWords (Splicer::Name First ; 1 ); 1 ); Left (Splicer::Name First; 1 ) & Left (Splicer::Name Last; 1 ) ) Shouldn't this be: Case( PatternCount ( Splicer::Name First ; "&" ); Left (Splicer::Name First; 1 ) & Left (RightWords (Splicer::Name First ; 1 ); 1 ); Left (Splicer::Name First; 1 )) & Left (Splicer::Name Last; 1 ) You included too much in the case.
Slobey Posted August 26, 2005 Author Posted August 26, 2005 Thanks for responding Ralph, it was all included in the case because if the first name includes "&", then the last name will be empty. But I tried your revised calc and I got nothing in the field, with mine I only get the T.
comment Posted August 26, 2005 Posted August 26, 2005 Your original calculation should return "TA" for ["Terry & Archie" ; "Bull"], and "TB" for ["Terry" ; "Bull"]. Check your data and your relationships.
Slobey Posted August 26, 2005 Author Posted August 26, 2005 Sorry guys, I'm brain dead. I had the fields reversed. Thanks for you help
RalphL Posted August 26, 2005 Posted August 26, 2005 It works for me. Just made a test file, I get TA.
Recommended Posts
This topic is 7097 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