2 Replies Latest reply on Apr 28, 2016 5:27 PM by Ashish Chaudhari

    Creating Calculated Field

    James Rogers

      I am attempting to create a function that separates two value ranges: values that are >0 and values that are greater than 0 but less than or equal to 2.00.  My intent is to visualize these two categories. I have made a couple of attempts with these formulas, but without success:

       

      (1).

      IF SUM([Hours]) > 2.00 THEN "Total Overtime"         

      ELSEIF "Incidental Overtime"

      END

       

      (2).

      IF SUM([Hours]) > 2.00 THEN "Total Overtime"

      ELSE "Incidental Overtime"

      END

       

      (3).

      IF AVG([Hours]) <= 2.00 THEN "Incidental Overtime"

      ELSE "Total Overtime"

      END

       

      Any assistance is appreciated...

        • 1. Re: Creating Calculated Field
          Chris McClellan

          Do you have any sample data ?  I think what you're trying to do is:

           

          IF sum([Hours]) >= 0 and sum([Hours]) <= 2 
          THEN "Total Overtime"
          ELSE "Incidental Overtime"
          END
          

           

          That will return "Total Overtime" when sum([Hours]) is 0-2 (inclusive), but any negative number or number above 2 (so 2.0000001 and up ) will be Incidental Overtime.

          • 2. Re: Creating Calculated Field
            Ashish Chaudhari

            Hi James ,

             

            The calculate fields that you have created is having logical error. Please refer to Chris's calculation which looks perfect and I am sure it will serve you purpose.

             

            Your ranges are overlapping with each other. There will be some elements of >0 that would be also part of > 0 and <=2.

             

            Thanks and Regards,

            Ashish Chaudhari