Aussie John Posted February 2, 2015 Share Posted February 2, 2015 I have a function with generates acronyms, handily found here. It needs refining to NOT give the first letter if the field has only one word. In that instance i just want the single word. Acronym(type) Case( WordCount (type) > 1; Upper ( Left (type; 1)) & Acronym ( RightWords ( type; WordCount( type ) - 1)); Upper ( Left ( type; 1)) ) Assistance always appreciated. Request for Information = RFI Advice=Advice Link to comment Share on other sites More sharing options...
eos Posted February 2, 2015 Share Posted February 2, 2015 Try Case ( WordCount ( type ) = 1 ; type ; Filter ( Proper ( type ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) ) Link to comment Share on other sites More sharing options...
comment Posted February 2, 2015 Share Posted February 2, 2015 I have a function with generates acronyms, handily found here. It needs refining to NOT give the first letter if the field has only one word. I would suggest you do this "refining" at the point where you call the custom function, not within the custom function itself. Although if you really wanted, you could do it this way; Acronym ( text ; result ) = Let ( countWords = WordCount ( text ) ; Case ( countWords = 1 and IsEmpty ( result ) ; text ; IsEmpty ( text ) ; result ; Acronym ( RightWords ( text ; countWords - 1 ) ; result & Upper ( Left ( text ; 1 ) ) ) ) ) which has the further advantage of being tail-recursive - just in case you need an acronym that's more than 10k characters long... -- BTW, where exactly is "handily found here"? Filter ( Proper ( type ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) One wonders whether you know about umlauts... Link to comment Share on other sites More sharing options...
Aussie John Posted February 2, 2015 Author Share Posted February 2, 2015 BTW, where exactly is "handily found here I thought my posted "solution" was one I found in these fm forums but was actually a Ray Cologon, NightWing Enterprises solution found at - http://www.briandunning.com/cf/33. Comment, thanks for your alternative Custom Function although I had already decided to refine at the base calculation. As for the function you suggested I am not sure how and what "result" is. Link to comment Share on other sites More sharing options...
Aussie John Posted February 2, 2015 Author Share Posted February 2, 2015 Try Case ( WordCount ( type ) = 1 ; type ; Filter ( Proper ( type ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) ) Thanks. Always another way to skin a cat. Although apparently umlauts are important. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 3365 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