Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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
 

Try

Case ( 
  WordCount ( type ) = 1 ; 
  type ; 
  Filter ( Proper ( type ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) 
)

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... :hmm:

  • 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.

  • 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.