I try to create a top 10 list of customers from a dynamic list on a postgres database. The dynamic list has a parameter on starting date. In the list I defined an Include Pre-Filter on column ‘lineprice’ as ‘${analytical.top(10)}’ and selected ‘exclude empty cells’. When I preview it fails with message:
‘Query could not be prepared: Error preparing statement for executing the report query.’
When I look in the database server log I notice it is missing the closing quote at the date filter:
AND h.dtpakk >= '01-oct-2016) colQry
When I replace the analytical function with a fixed range it that runs without problem.
From the database log:
2016-12-06 11:04:07.053 CET,“postgres”,“DWDEV0”,26750,“10.236.80.192:49849”,5845
9355.687e,2,“idle”,2016-12-05 17:18:29 CET,9/15551,0,ERROR,42601,"unterminated quoted string at or near “”'01-oct-2016) colQry
(…)
"SELECT * FROM (SELECT * FROM (SELECT "“xx__rs_col_0"”, "“xx__rs_col
_1"”, "“xx__rs_col_2"” FROM ( SELECT * FROM (SELECT ““envkd”” AS "“xx__rs_col_0”
", ““lineprice”” AS "“xx__rs_col_1"”, ““kgpka9"” AS ““xx__rs_col_2"” FROM ( SELE
CT h.envkd,
h.dtpakk,
h.uwref,
h.vrnumm,
h.naam1,
h.kgpka9,
l.orderr,
l.artkd,
l.oraant,
l.vrtela,
l.kstprs,
l.vrtela * l.kstprs as lineprice
FROM ““KPIDW””.ce1_miuitk h,
““KPIDW””.ce1_miuitr l
WHERE
h.envkd = l.envkd
AND h.vrfsrt = l.vrfsrt
AND h.uwref = l.uwref
AND h.vrnumm = l.vrnumm
AND h.dtpakk >= '01-oct-2016) colQry
WHERE (( ““lineprice”” >= 0) AND ((NOT((”“lineprice”” IS NULL)))))) filterQry
WHERE (NOT(("“xx__rs_col_1"” IS NULL)))) aliasQry) orderQry
ORDER BY "“xx__rs_col_1"” DESC) limitQry LIMIT 50 OFFSET 0