SAP Knowledge Base Article - Public

3803301 - ADDMONTHTODATE Formula Error in Story Calculated Column

Symptom

  • Creating a calculated column in a Story Report using ADDMONTHTODATE(Date, Number) returns a validation error.
  • Error message: "Formula could not be computed: Function 'AddMonthToDate' expects parameter 2 of type 'Number', but receives 'Number'; try using the expected parameter type. Please complete or rewrite the formula."

Environment

  • Query Designer - Filter, Calculated Column, Params

Reproducing the Issue

  1. Navigate to Report Center and create or edit a Story Report.
  2. Create a calculated column with: ADDMONTHTODATE(Date Field, Numeric Field).
  3. Validate the formula
  4. Observe the validation error indicating a datatype mismatch for parameter 2.

Cause

ADDMONTHTODATE in Story calculated columns requires the second parameter to be of a strict Integer subtype, not a generic decimal Number type.

The numeric field [Probationary Report Number], while appearing as a Number, is internally stored as a decimal/float numeric type within the model. This does not satisfy the Integer subtype expectation of ADDMONTHTODATE.

Resolution

  1. Edit the calculated column formula to explicitly cast the second parameter to an integer.
  2. Use the pattern: ADDMONTHTODATE([Date field], TOINTEGER(TOTEXT([Number field]))).
  3. Validate the formula in Query Designer and run Preview to confirm the calculation completes without errors.

See Also

Keywords

Story Reports, Query Designer, calculated column, AddMonthToDate, ADDMONTHTODATE, validation error, datatype mismatch, number parameter, integer cast, TOINTEGER, TOTEXT, date function, TONUMBER , KBA , LOD-SF-ANA-SAC-QDS , Query Designer - Filter, Calculated Column, Params , Problem

Product

SAP SuccessFactors Platform 2605