Hi, I want to add a date range filter on the dashboard, the type I should use is Field Filter, but my SQL query with variables returns error:
No special value for parameter 3.
What does this mean? How to correct it? Thanks a lot.
In my case:
Database: SQL
The field content contains a json like this:
{
"date": "2023-09-14T07:39:21.842Z",
"eventinfo": {
"item": "111",
"index": "0"
},
"sessionid": "MsSaLCsNJCeO2OtSxmWhWTcvzchp5iXC",
"eventname": "results-click-card-item",
"pageinfo": {
"total": "198",
"size": "20",
"page": "1",
"totalpages": "10",
"params": "?query=test",
"searchstring": "test"
},
"pagename": "pg-search"
}
Part of SQL query:
select count(distinct(A.content->'pageInfo'->>'searchString')) as sub_count, DATE_TRUNC('month', TO_DATE(A.content->>'date', 'YYYY-MM')) as month
from portal_logs A
where A.content->'pageInfo'->'searchString' is not null
[[and DATE_TRUNC('day', TO_DATE(A.content->>'date', 'YYYY-MM-DD')) between DATE_TRUNC('day', TO_DATE({{start_date}}, 'YYYY-MM-DD')) and DATE_TRUNC('day', TO_DATE({{end_date}}, 'YYYY-MM-DD'))]]
group by A.content->>'sessionId', month
In my qustion start_date and end_date are Field Filter variables, associated to Content->Date, with filter type month and year.