Postgres query:
SELECT "KPMID",
"CustomerID" as "cust_id::multi-filter",
"KPM_Name",
"Report_Period" as "rep_id::multi-filter", '<input type="text" ng-model="$select.search"/>'
"Actual",
CASE WHEN "TrendCode" = 'R' THEN '<img src="http://34.213.131.167/images/red.png" height="20px" width="100px"/>'
WHEN "TrendCode" = 'Y' THEN '<img src="http://34.213.131.167/images/yellow.png" height="20px" width="100px"/>'
ELSE '<img src="http://34.213.131.167/images/green.png" height="20px" width="100px""/>'
END
"TrendCode",
CASE WHEN "CStatusCode" = 'R' THEN '<img src="http://34.213.131.167/images/red.png" height="20px" width="100px"/>'
WHEN "CStatusCode" = 'Y' THEN '<img src="http://34.213.131.167/images/yellow.png" height="20px" width="100px"/>'
ELSE '<img src="http://34.213.131.167/images/green.png" height="20px" width="100px""/>'
END
"CStatusCode",
CASE WHEN "OutlookCode" = 'R' THEN '<img src="http://34.213.131.167/images/red.png" height="20px" width="100px"/>'
WHEN "OutlookCode" = 'Y' THEN '<img src="http://34.213.131.167/images/yellow.png" height="20px" width="100px"/>'
ELSE '<img src="http://34.213.131.167/images/green.png" height="20px" width="100px""/>'
END
"OutlookCode" FROM public."KPMDataReport";
Output:
Two dropdowns are being displayed by executing the above SQL query, my requirement is to get the query executed on click of a button. So, how could I achieve this using redash tool.
If this is not possible at all through redash, then how to embed a JavaScript code as a part of SQL query and get this done. Redash instance is running on aws.