Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Thanks for all the help. This is a great forums.

When I scan a part number it sometimes come up with 1Pxxxxxxxxx, the rest of characters real part number. The real part number can have 8 - 10 characters.

How can I remove the first 2 characters (1P) if they exixt?

Again Thanks!

Posted

Well you can use the left, right, position functions but maybe you should supply us with more information so that we can help you in greater detail.

Is there always 2 characters in the beginning that you want to get rid of? If so is the second character always a Alpha-character? etc etc.

The more detail the better.

Posted

Here's some examples:

1PP1234LPMM - will need to trim the starting 1P

1PM123456PMM9 - will need to trim the starting 1P

M123456PMM9 - No need to do any trim

P12345 - No need to do any trim

Thanks

Posted

Ok...

so how does one determine if something needs to be trimmed or not? You still have not answered my earlier questions. We would need the rule to determine if it needs to be trimmed or not, otherwise how can we know when to trim it or not? Does it need to be trimmed only when it starts with 1P ?

Posted

Should work... unless the character sequence "1P" occurs elsewhere in the string and truly belongs there.

Posted (edited)

It seems pretty clear that 1P should only be removed if it exists as the first two characters. In which case, Lee, your calc would also remove 1P if it exists later in the string. This should protect from that possibility ...

If (

Left ( PartNumber ; 2 ) = "1P" ;

Substitute ( PartNumber ; Left ( PartNumber ; 2 ) ; "" ) ;

PartNumber )

LaRetta :wink2:

Edited by Guest
Corrected for vs. 7
Posted

Darn, I missed that it was for v7, I responded to his profile of v6.

Yes, Ted, I'm aware of that too.

so now, Thanh has a couple of choices.

Lee

Posted (edited)

Darn is right, Lee. I saw version 6!! Change the commas to semi-colons for vs. 7. :blush2:

Update: I corrected the above calc

Edited by Guest
Added Update
Posted

I'm afraid your calc suffers from the same flaw as Lee's:

If (

Left ( PartNumber ; 2 ) = "1P" ;

Substitute ( PartNumber ; Left ( PartNumber ; 2 ) ; "" ) ;

PartNumber )

If the test is true, the substitution part evaluates as:

Substitute ( PartNumber ; "1P ; "" )

Suppose the PartNumber is entered as "1P55AA1P". Your result will be "55AA", instead of "55AA1P".

Try:

Case (

Left ( PartNumber ; 2 ) = "1P" ;

Right ( PartNumber ; Length ( PartNumber ) - 2 ) ;

PartNumber

)

This topic is 6957 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.