February 2, 201510 yr 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
February 2, 201510 yr Try Case ( WordCount ( type ) = 1 ; type ; Filter ( Proper ( type ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) )
February 2, 201510 yr 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...
February 2, 201510 yr Author 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.
February 2, 201510 yr Author Try Case ( WordCount ( type ) = 1 ; type ; Filter ( Proper ( type ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) ) Thanks. Always another way to skin a cat. Although apparently umlauts are important.
Create an account or sign in to comment