Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6948 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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 ?

Posted

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.

Posted (edited)

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
Posted

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?

Posted

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# ; "" ) )

Posted

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

Posted

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 ) ;

""

)

This topic is 6948 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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