1 Reply Latest reply on Dec 1, 2011 5:24 AM by Jonathan Drummey

    Calculated Field If Question

    Conor Branch

      I am trying to write the following piece of code below so that it sets all values where the [Quantity] field <1 and >-1 to 0 for the calculated field I am creating, but I cannot seem to figure it out any help would be great.  Thanks.

       

      if[Quantity]<1 and <-1

      then 0

      end

        • 1. Re: Calculated Field If Question
          Jonathan Drummey

          If the Quantity field is an integer, then it seems like all you want to do is set a value to 0. If not, then what you state in the text seems like you're trying to set Quanty to 0 for values between -1 and 1. Here's a calculated field to do the latter:

           

          IF [Quantity] > -1 AND [Quantity]<1 THEN

            0

          ELSE

            [Quantity]

          END

           

          Is this what you're looking for?