2 Replies Latest reply on May 23, 2013 5:17 AM by ninja

    Check field value range

    GregSmith_1

      Title

      Check field value range

      Post

           Hey All --

            

           I need to check a field for a value range in order to set a field.

           if <$400 set to 1

           if >$1000 then set to 3

            

           But I don't know how to phrase if the range is >$400 but <$1000 then set it to 2

           Can anyone assist me with this?

           thanx,

            

           greg

        • 1. Re: Check field value range
          stcav

               Hi Greg,

               I would suggest an expression like:

               If ( value < 400 ; index = 1 ;

                   If ( value > 999 ; index = 3 ;

                        index = 2 ) )

               In a script you might use: If, Else If, Else, End If.

               Note that the way you've phrased the question does not specify any result for values of precisely $400 or $1000.

               Stephen

          • 2. Re: Check field value range
            ninja

                 Alternatively to the nested IF scenario, explore the CASE function.

                 Case (

                 value < 400 ; 1 ;

                 value > 999 ; 3 ;

                 2   )

                  

                 Case is a natural replacement for nested " If's ".  Both will work.

                 Keep in mind that the Case function will stop when the first "true" condition is hit.

                 Nested If's will continue through the entire nest.