SAP Knowledge Base Article - Public

2875546 - Subtracting a number with decimal cases from a variable being shown as incorrect formula

Symptom

When using some formula like var x = z - 1.1;, SAC show an error in the code with the error message below:

  • Type mismatch: Cannot convert from "Unknown type" to "number".

Environment

SAP Analytics Cloud 2019.24.5 and before

Reproducing the Issue

Open any component onClick script part and write:

var x = 1.1;
x = x - 1; //no issues with subtracting integer

var y = 1.1;
y = y - 1.1; //a double/float is not identified as a number for some reason

Cause

A code issue.

Resolution

In release 2020.01 the error warning will no more be triggered.

More information about releases here:
https://www.sapanalytics.cloud/product_updates/

Keywords

subtraction, math, formula, sac, error, mathematic, strange, subtraction, adding, error, code, convert, unknown , KBA , LOD-ANA-BI-APP , Analytics Designer and Data Analyzer , Bug Filed

Product

SAP Analytics Cloud all versions