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 field that has both customer # the customer in one field!

I need to split the two out. simple yes, or so I thought untill I noticed that sometimes they did not enter the customers #.

So I need a calc that will split them. Only grab the first numbers for the customer # and only grap the text for the customer name.

Any Ideas?

Thanks

Devin

How about an example of what the data looks like.

Lee

  • Author

Some times they put down:

112 KC Power & Light

and some times they put

KC Power & Light

112 is the customer #

The customer is not the same for every record nor is it the same number of digits.

Does this help?

Devin

Devin,

I guess it would depend on how exactly the customer number is structured and Customer Name.

You can use functions such as LeftWords, Right, Filter, GetAsNumber, Position, etc. It all really depends on the data that you have in your fields.

It can be as simple as GetAsNumber to get the account number into a field if its strictly numerical. etc etc...

BTW is customer# always on the left side of the text field ? And is it possible that there is a number into the customer name ?

  • Author

BTW is customer# always on the left side of the text field ? And is it possible that there is a number into the customer name ?

The customer # is allways on the left side! When it is placed it has a space between number and name.

Yes there is a number is a customer name. I know of one so far.

If this is always true, then for customer Acct number, you can use the LeftWords Function.

LeftWords (Field;1)

For the rest of the account name, you can use.

RightWords ((Field); WordCount(Field)-1)

Edited: Oops forgot to put the logic in there.

Try this for the account number field.

Let ( n=GetAsNumber(LeftWords (Field;1);

Case (Length ( GetAsNumber(n)) = Length (n); c; field)

)

)





and for the account name field


Let ( [ n=GetAsNumber(LeftWords (Field;1); c= RightWords ((Field); WordCount(Field)-1)];



Case (Length ( GetAsNumber(n)) = Length (n); n; "")

)

Edited by Guest

  • Author

Devin,

I guess it would depend on how exactly the customer number is structured and Customer Name.

You can use functions such as LeftWords, Right, Filter, GetAsNumber, Position, etc. It all really depends on the data that you have in your fields.

It can be as simple as GetAsNumber to get the account number into a field if its strictly numerical. etc etc...

The customer number is only numbers. I guess I'm not sure of the filter part.

Here is a calc that I would use to grab the customer name if every record had a customer # placed.

if(wordcount(cust) < 2, cust,rightwords(cust,wordcount(cust)-1))

I guess the part I'm missing is the filter part?

Ok

so

customer# :

[color:red]Case(

Length ( GetAsNumber ( LeftWords ( customerAll ; 1 ) ) ) = Length (LeftWords ( customerAll ; 1 )) ;GetAsNumber ( LeftWords ( customerAll ; 1 ) );

""

)

(the case statment look if the first word is composed of all and only numbers ... as I wish that the first word of a customerName isn't all numbers only ) :)

customerName :

[color:red]Trim ( Substitute ( customerAll ; customer# ; "" ) )

  • Author

This almost worked! it was able to get the customer # expect for when the customer # was 01. This is not that big of a deal because I need to change that to another #.

Thanks so much!

Devin

Yes, you are right...

So change the calc of customer# to:

Case(

Length ( Filter( LeftWords ( customerAll ; 1 );"0123456789" ) ) = Length (LeftWords ( customerAll ; 1 )) ;LeftWords ( customerAll ; 1 ) ;

""

)

  • Author

Yeah! that did it!

Thanks again!

Devin

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.