Can you share a screenshot of your setup and the result? If you're in a retool app, the data will come back as array of data per column, so the first array will be the values for deviationNumber and the second for overall_impact, you can transform them in the "transform results" section below the query by putting in
return formatDataAsArray(data)
That might give you something more familiar and easier to debug. Full docs here.
The issue isn't quite jumping out yet. It would be helpful to see select "deviationNumber", severity, occurence, detection, severity * occurence * detection as overall_impact from deviations
from the state tab so that we can see the data types