I created a simple dashboard with Pentaho CDE. I would like to pass a variable contained in the URL to a query sql as a parameter. I have a custom parameter that retrieves the value from the URL string named par_name. I can not use this value in the query. Within the query the parameter is entered as follows: $ {par_name} Any suggestions? Thank you !!!!
0
votes
1 Answers
1
votes
The parameter syntax is correct (minus that extra whitespace): ${par_name}.
But you must also do two more things:
- Register the parameter in the query parameters;
- Have a component that calls the query and passes the JS parameter to the query.
For 1, just open the parameters box of the query and enter par_name on the first column. You don't need to fill in anything else, unless you want a default value.
For 2, you need to go to the component of your dashboard and on parameters add a parameter and fill in the name of the query parameter on the 1st column and the JS variable on the 2nd column. More often than not they're the same, but still need to be mapped.
Queries are not run unless called by a component, so you need a component to execute/update for the query to run.