pentaho-cdepentaho-ctools

How to pass a variable obtained from query component into a query on Pentaho CDE?


I managed to get data as variable with Query component. Now I want to pass this variable into a query. Here is what I did:

On Query Component: myresult='NYC' in my example.

enter image description here

The query on Datasources: I use this one to display a chart, when I change ${myresult} to 'NYC', it works fine. But with ${myresult}, the chart is not displayed.

enter image description here

I also tried with

> Dashboard.setParameter() 

On post fetch of Query Component, but still the same...

enter image description here

I also created simple param and select param (which is not displayed on dashboard) but it doesn't solve the problem.

It's been hours I'm stuck , would love to get some help!

///////////////////////////////EDITED/////////////////////////////

On Component Panel - simple parameter :

enter image description here

On Component Panel - Pie chart - Parameters :

enter image description here

On Component Panel - Pie chart - listeners : I selected param_city

On Datasource - parameters of piechart query:

enter image description here


Solution

  • you need to pass parameter myresult and listner in Parameters field of both chart and datasource used for chart. like this