1 Reply Latest reply on Jun 6, 2013 12:37 PM by Charles Dubant[eFrontech]

    CASE WHEN formula inquiry

    1012414
      Hi. I'm encountering a problem with my formula for the column of one of my reports.

      The condition should be, if the value is greater or equal than 8.5, then the value displayed should be 8.50, or else, if the value is less tham 8.50, it should retain the same value (e.g. If result is 4.00, the value displayed should still be 4.00)

      I've been encountering errors with this formula. Can someone spot the problem? This was done under the Activity/Appointment module:

      case WHEN "- Custom Number/Integer".S_NUM_1 >= 8.5 then '8.50' else "- Custom Number/Integer".S_NUM_11.00 end*

      I would appreciate your help on this one.
        • 1. Re: CASE WHEN formula inquiry
          Charles Dubant[eFrontech]
          Hi,

          I think that the issue you are facing (though you don't post any error message or what) comes from a data type conflict.

          If I were you, I would make sure that all the data is FLOAT (because you're comparing with floating numbers).

          This would look like this if you remove the *1.00 which stands for a null operation and make sure you're comparing FLOATs with FLOATs :

          CASE WHEN (CAST("- Custom Number/Integer".S_NUM_1 AS FLOAT) >= CAST('8.5' AS FLOAT))
          THEN CAST('8.5' AS FLOAT)
          ELSE CAST("- Custom Number/Integer".S_NUM_1 AS FLOAT)
          END

          Charles DUBANT.

          http://www.dubant.com/