SAP Knowledge Base Article - Public

3304995 - Error when converting a string field using ToNumber() function in Story report

Symptom

User is trying to convert a string field to number in query designer using ToNumber() function but gets "Internal error occurred while processing" error message when trying to preview the query. 

User is trying to convert a calculated dimension but receives the error message: "Formula could not be computed: Choose a property for dimension xxxx in function "ToNumber". Please complete or rewrite the formula."




 Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP SuccessFactors People Analytics

Reproducing the Issue

User is trying to convert a string field to number in query designer using ToNumber() function but gets "Internal error occurred while processing" error message when trying to preview the query. 

  1. Go to Report Center
  2. Edit the Story report
  3. Edit the data source query
  4. Create a new calculated column
  5. Use the function ToNumber() and enter string field to convert to number
  6. See that the formula is all valid
  7. Click on Preview Query > "Internal error occurred while processing"

User is trying to convert a calculated dimension but receives the error message: "Formula could not be computed: Choose a property for dimension xxxx in function "ToNumber". Please complete or rewrite the formula."

  1. Go to Report Center
  2. Edit the Story report
  3. Select the table and click on Designer
  4. Add dimension> Create calculated dimension
  5. Use the function ToNumber() and enter string calculated dimension field to convert to number
  6. Error "Formula could not be computed: Choose a property for dimension xxxx in function "ToNumber". Please complete or rewrite the formula." occurs upon saving.

Resolution

For converting a string field to number, we would need to filter out the values that are in text form as well as (no values). After excluding the values that are in text form and (no values), conversion works and error does not occur when trying to preview the query.

ToNumber() function only accepts the dimensions, but not the calculated dimensions hence the error when trying to convert a calculated dimension string field to number. This is working as designed.

See Also

3303885 - Few calcuations are not allowed in the Story report Calculation Editor

Keywords

Story query designer, ToNumber() function does not work, Error when creating calculated column, How to convert string field to number in Story, convert to number story, function, functions, calculation, editor, calculated, column, columns, month, tonumber, datasource, query, designer  , KBA , LOD-SF-ANA-SAC-QDS , Query Designer - Filter, Calculated Column, Params , Problem

Product

SAP SuccessFactors HXM Core 2211