Category / Section
How can I fix the issue where a numeric value doesn't fit into System.Decimal?
Published:
When encountering the error message "Numeric value does not fit into System.Decimal," it typically indicates that a numeric value exceeds the acceptable range for a System.Decimal type which will be used by Bold BI. Applying the `ROUND` function can help ensure that the values are within an acceptable range.
Steps to Resolve the Issue
1. Identify the Columns to Round
Based on the error message, identify the columns that need rounding.
2. Apply the ROUND Function
Use the `ROUND` function to round these columns to 2 decimal places. The syntax for the `ROUND` function is as follows:
ROUND([column], 2) AS [Alias Name]
Example
Here is an example of how to update the query in code view mode to include the `ROUND` function:
SELECT
ROUND(`total_sales`, 2) AS `sales`,
ROUND(`total_income`, 2) AS `income`
FROM `test`.`marketing_data` AS `marketing_data`
Note:
- The `column` might be a GUID for MongoDB or an SQL extract mode.
- Use your specific column name for a live connection.
Additional References
By following these steps, you can resolve the "Numeric value does not fit into System.Decimal" issue effectively.