1 Reply Latest reply on Dec 31, 2013 1:43 AM by erolst

    Validation Calculation...

    techxp

      Good day all,

       

      I am currently in the midst of attempting to create a validation calculation for a field that has to include in series two numbers, five characters and five numbers e.g. 14CHAETO20131.

      If anyone has any helpful information I would greatly appreciate your input. I have attempted to use :

      "Filter ( MiddleValues (Testing::TourNumber;1 ; 2 ) ; "0123456789" ) and Filter ( MiddleValues (Testing::TourNumber;3 ; 6 ) ; "ABCDEFGHIJKLMNOPQRSTVWXYZ" ) "

       

      However I suspect that the two Filters cause a conflict in the calculation causing it to fail.

       

      Kind Regards

      Michael Mayrhofer

      Pack Safari

        • 1. Re: Validation Calculation...
          erolst

          techxp wrote:

          However I suspect that the two Filters cause a conflict in the calculation causing it to fail.

           

          Wrong functions; use Left, Middle and Right for strings, and their xValues counterparts for dealing with CR-delimited lists. Also, you'd need to use IsEmpty() to get a Boolean result; OTOH, in this case you want to check on a specific length.

           

          Try

           

          Let ( [

          f = Testing::TourNumber ;

          digits = "0123456789" ;

          chars = "ABCDEFGHIJKLMNOPQRSTVWXYZ" ;

          l = Length ( Filter ( Left ( f ; 2 ) ; digits ) ) = 2 ;

          m = Length ( Filter ( Middle ( f ; 3 ; 6 ) ; chars ) ) = 6 ;

          r = Length ( Filter ( Right ( f ; 5 ) ; digits ) ) = 5

          ] ;

          l and m and r

          )