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

Hi everyone,

I am trying to create a field that will count only the letters in another field. I have tried different formulas to count them using getastext, filtervalues patterncount and substitute but can't figure it out. Basically if field a contains an alpha character (a-z) I want just the number of those characters to show up in field b. For example:

field a contains 11a24b

field b would show 2

field a contains Pend12

field b would show 4

Any ideas?

Thanks

Mike

  • Author

I got it.

Length(field1) - length(getasnumber;field1))

Unless someone has a more effecient calc.

Mike

  • Author

spoke too soon.

If field a starts with a zero, my formula counts it as text. so field b shows 1 it field a is 01562213. Still need help

Thanks

How about:

Length ( YourField ) - Length ( Filter ( YourField ; "0123456789 " ) )

  • Author

That was it! Thanks

What if the field contains a character that is not a number or or a letter? Might try...

Length (Filter(Lower (MyText); "abcdefghijklmnopqrstuvwxyz"))

And what if it contains an accented or Greek letter?

  • Author

I am using this to find valid PO's in my database. The PO should only contain numbers, nothing else. So if I use Comments formula and subtract the numbers then if anything is left the PO is invalid. It doesn't matter what character is left. My calc is

case(

Length (PO field) - Length ( Filter ( PO field; "0123456789 " ) ) > 0 ; "Invalid";"Valid")

Seems to work for my purposes, or am I missing something?

Not really. Except you could make it a bit simpler:

PO field = Filter ( PO field ; "0123456789 " )

The result could be a Number, formatted to show non-zeros as "Valid" and zeros as "Invalid".

  • Author

But that calc would show 061b493 as 061493 and call it valid, I want to flag everything that has a non numeric character anywhere in the field as invalid.

But that calc would show 061b493 as 061493 and call it valid

No, it would return 0 (False) and call it "Invalid". Mind you, the formula is the entire line. IOW, the calculation field cValidPO =


PO field = Filter ( PO field ; "0123456789 " ) 

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.