CheckDigit_swissUID ( swissUID )
Generates the check digit for swiss UID / IDE / VAT number
Average rating: 3.0 (1 vote) Log in to vote
Olivier Caulet - Show more from this author
Helixir http://www.caulet.ch/helixir |
CheckDigit_swissUID ( 10932255 )
1
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
The swiss UID is composed of 9 numbers, randomly generated and contains no information about the enterprise (anonymous identifier). The Swiss origin of the number is indicated by the "CHE" prefix, which is the three-letter country code of the ISO 3166-1 standard. The last number refers to the check digit (C) determined by the Modulo 11 standard calculation method.
This function generates the check digit for swiss UID / IDE / VAT number
Comments
Christoph Kaufmann, CLK.ch Jun 17, 2019 |
||
Thank you for the function. I had to set Filemaker's language to French in order to get it recognised. For all non french speakers, here's a slightly enhancend version in English. It returns 1 (correct) or 0 (false): Let ( [ UIDnumber = Filter ( swissUID ; "0123456789" ) ; UIDtest = ( + Middle ( UIDnumber ; 1 ; 1 ) * 5 + Middle ( UIDnumber ; 2 ; 1 ) * 4 + Middle ( UIDnumber ; 3 ; 1 ) * 3 + Middle ( UIDnumber ; 4 ; 1 ) * 2 + Middle ( UIDnumber ; 5 ; 1 ) * 7 + Middle ( UIDnumber ; 6 ; 1 ) * 6 + Middle ( UIDnumber ; 7 ; 1 ) * 5 + Middle ( UIDnumber ; 8 ; 1 ) * 4 ) ; checkdigit = 11 - Mod ( UIDtest ; 11 ) ] ; GetAsBoolean ( Length ( uidnumber ) = 9 and Right ( UIDnumber ; 1 ) = checkdigit ) ) |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.