Executing an SQL calculation and update

I'm attempting to multiply 3 different columns against each other ((a * b) * c ) and then update a 4th column.

So far I've tried:

SELECT "deviationNumber",
severity * occurence * detection AS overall_impact
FROM deviations

I get an array back, but it doesn't seem to match up with what I'm expecting.

Should I abandon trying to do with SQL and switch to Javascript?

If so, how should I go about it?

Thanks in advance.

Hi @James_Gould,

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.

Hi Mike,

he's a screenshot: