I'm trying to create a visualised data based on Native SQL query result, so I create a Native SQL question with complex parameter default value for creation_date field. Below is the query used :
SELECT CASE
WHEN msi.organization_id = 101 THEN
'Store A'
WHEN msi.organization_id = 103 THEN
'Store B'
WHEN msi.organization_id = 102 THEN
'Store C'
END perusahaan,
to_char(msi.creation_date, 'YYYY-MM') periode,
msi.segment1
FROM mtl_system_items_b msi
WHERE msi.organization_id IN (101,102,103)
AND msi.creation_date >= [[ {{FromDate}} --]]last_day(add_months(SYSDATE,-6))+1
AND msi.creation_date <= [[ {{ToDate}} --]]trunc(last_day(SYSDATE))+0.99999
The Native SQL Question can run fine, and it also run fine on Dashboard. But when I try to use it for Custom Question, Metabase throw following error :
I know I can just forget the parameters and use Field Filters but is there a way to keep the parameters?
Edit :
Forgot to mention, I'm using Metabase 0.36.0 with Oracle OJDBC8.