How to add a select all option to select component in CDE

后端 未结 3 1677
心在旅途
心在旅途 2021-01-25 10:45

for a students projects we are working with Pentaho CDE to create a dashboard. At first it works fine, but now we are hanging at the point adding more than one Select Component.

相关标签:
3条回答
  • Use SQL expression CASE:

    SELECT * FROM table WHERE cities LIKE (case when ${city} = 'ALL' then '%' ELSE ${city} end)

    0 讨论(0)
  • 2021-01-25 11:33

    If you dont want use like.

    SELECT * from table_name where column_name = case when ${param} = 'ALL' then column_name else ${param} end
    
    0 讨论(0)
  • 2021-01-25 11:35

    Two approaches:

    1. On your single select query add (possibly hardcoding) a "All" option and have some JS logic learn how to handle it;

    2. Use multi select components. However, bear in mind that the parameter values on a multi select component are stored as an array in javascript, whereas the parameter value will be passed as a comma separated list to the query. So, if you want to use a multi select parameter in a SQL query you will most likely use it inside a IN condition.

    Finally, check your pentaho.log file. The errors and exceptions will be logged there.

    0 讨论(0)
提交回复
热议问题