Sure no problem, and thanks for responding, but i still can't seem to get it to work, appreciate it's also a very simple SQL statement and having written SQL for years am stumped at why.
I retrieve the data from a View in SQL server in to vw_PS_Data, this new query (Query Json with SQL) then tries to count the number of rows that have a rank of 1 for instance, this column is a BigInt, I have attached some screen shots.
I'm curious if something like the following works:
SELECT COUNT(Product_ID) AS Num FROM {{formatDataAsArray(vw_PS_Data.data)}} where PriceRank='8'
You shouldn't need to wrap your column names in {{}} and Query JSON with SQL also expects an array of objects hence the formatDataAsArray helper function (docs).