Set Function on non-numeric data is not allowed

here’s the screenshot getMetaData. is it because TAX return as varchar ?

sorry, I have no idea, I only follow the datasource from developers.
I haven’t tried to convert to json.
thanks for the advice, yesterday I can’t upload image from my computer.

Possibly, does it happen all the time?

it runs flawlessly on previous machine. but now now I’m moving the code to another machine. the difference is just previous machine is on premise, and current machine is saas.

I would assume something in the data has text causing the varchar. Try to list out all fields in what makes up TAX and see. Or maybe one of the fields in TAX is varchar?

A quick and dirty fix is to use CAST() to DECIMAL or NUMERIC.