HI friends, I've been surprised by a calculation e...
# gd-beginners
HI friends, I've been surprised by a calculation error. It's new as of today, and it seems straightforward: "
Copy code
  "title": "Bad Request",
  "status": 400,
  "detail": "A result cache error has occurred during the calculation of the result",
  "resultId": "…",
  "reason": "Fact 'fact/sentiment/85bc3d7488ba4dba8d952910340b6b37' must have only numeric data type",
  "traceId": "…"
" but in checking through my original data source, there is nothing new in my 'sentiment' variable that warrants this response. it's a double precision, all values are numeric, it's seen in my LDM as a fact, nothing has changed. I’ve of course ensured the cache is freshly cleared. Any idea how to diagnose this further? I wish I can get a hint as to what the offending value is or looks like
As a diagnostic, I created a new workspace and connected the same exact data, and was able to use the sentiment variable without any trouble.
Hi Daniel, This is bit strange. As you correctly assumed, this usually indicates there’s a a fact with a non-numeric data type like for e.g. STRING. And using such fact in arithmetic with another fact usually fails with similar error. Are you able to list all values of the “sentiment” fact in your Analytical Designer of the affected workspace, please?
May I know what Data source and data type are you working with, please?
Yes, I’m able to list all the distinct values in my (redshift) data source. The variable is continuous in 0 to 1, so the distinct values are fairly enormous without rounding. There is no value found there that isn’t within 0 to 1. The variable has data type of double precision
Thanks a lot for all the details. Could you kindly check your model and verify if the GD data type is recognised as DECIMAL (12, 2), please?
Where might I check the gd data type? I’m only familiar with GD’s fact/attribute distinctions
What type is visible in modeler in dataset details -> Data mapping?
🙌 1
Hey @Daniel Muise, Did the change of the data-type fix the issue, please?
Oh, I did not see any way to change "STRING" to something else; I thought the question was just informational
Does it change when you refresh list of tables in modeler in edit mode? This should scan the tables in the database and adjust types accordingly.
Please check the exact data type in the database first.
This fixed the issue, thanks very much!