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.
- Go to Report Center
- Edit the Story report
- Edit the data source query
- Create a new calculated column
- Use the function ToNumber() and enter string field to convert to number
- See that the formula is all valid
- 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."
- Go to Report Center
- Edit the Story report
- Select the table and click on Designer
- Add dimension> Create calculated dimension
- Use the function ToNumber() and enter string calculated dimension field to convert to number
- 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
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