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

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

Recommended Posts

Posted

 

Hello! I am building a database and came up this little problem can help.

The identification number is composed of 9 digits, the first 8 digits being in series and the last one is digit check based on the algorithm of Luth, that is, instead of confirming and manually entering the identification number, there would be no a calculation / script that when creating a new record it created an identification number with the requirements above.

Here is an example:

19510889 2

19510890 0

19510891 4

Thank you,

Posted (edited)

Your requirement is not clear.

First , I don't know what "the algorithm of Luth" is. If you meant the Luhn algorithm, then your examples don't make sense, because the expected results would be:

19510889    9
19510890    7
19510891    5

Please clarify. - and no less importantly, please update your profile so that we know which version and OS you're using.

 

Edited by comment
Posted

 

Hello! My System is Windows 10 and the version is Filemaker Advanced 18.

I would like if possible that the first 8 numbers were a predefined series (eg 19510889), then Filemaker would compute and add the check digit (eg 9) to the field. That is, in the ID field (ex.) It appeared at the end 19510889 9 In other words, when creating a new registry it would automatically put the serial number + the verification digit

Examples:

John ID - 19510889 9

Steve ID - 19510890 7

Alex ID - 19510891 5

The verification digit is based on the Luhn algorithm. Thank you for your support.

Posted

I would use two fields for this: a SerialID field auto-entering a serial number (you can set the starting value at any number), and a calculation field (result is Number) =

While ( [
number = SerialID ; odd = True ; sumDigits = 0 
] ;
number ; 
[ 
digit = Mod ( number ; 10 ) ;
value = digit * ( odd + 1 ) ;
value = If ( value > 9 ; value - 9 ; value ) ;
sumDigits = sumDigits + value ;
number = Div ( number ; 10 ) ;
odd = not odd
] ;
10 * SerialID + Mod ( 9 * sumDigits ; 10 )
)

 

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