4 Replies Latest reply on Oct 2, 2012 3:53 PM by philmodjunk

    Syntax

    Kirk_1

      Title

      Syntax

      Post

           On my data viewer $discountcustminfsc = 154

           $bottomlinenumber = 299.54

           When i run this script the result is 154... I can't see why.

            

           Let ([

               ~newRate = Case ( $discountcustminfsc > $bottomLineNumber ;
                                   $bottomLineNumber ;
                                   $discountcustminfsc
                               )

           ] ;
                ~newrate
           )

        • 1. Re: Syntax
          philmodjunk

               substituting your values for the variables that contain them produces:

               Let ([

                   ~newRate = Case ( 154 > 299.54 ;
                                       299.54 ;
                                       154
                                   )

               ] ;
                    ~newrate
               )

               Since 154 is NOT greater than 299.54, the result of 154 is returned.

               and you could simplify this expression as:

               Case ( $discountcustminfsc > $bottomLineNumber ;
                         $bottomLineNumber ;
                         $discountcustminfsc
                         )

               There's no need in the expression you've posted for the Let function. (But perhaps this is actually part of a more complex caculation where you need that let function.

          • 2. Re: Syntax
            Kirk_1

                 Thank you

            • 3. Re: Syntax
              Kirk_1

                   I'm struggling with this today...

                   What I'm trying to do is... if there is a number in $adjustedClassMultiplier then use that number for $ClassMultiplier.

                   This does not return a value...

                    

                   Set Varable [ $classmultiplier; value:

                   Case ( $AdjustedClassMultiplier > "" ; $AdjustedClassMultiplier  )

              • 4. Re: Syntax
                philmodjunk

                     Try $AdjustedClassMultiplier > 0

                     or

                     Not IsEmpty ( $AdjustedClassMultiplier )