Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view
Hello,
I have a dataset that represents a query like this:

Select * From Table where email like 'Lo%';

Now, I created a cockpit that includes this dataset as a table widget and I'd like to replace 'Lo%' with an input string, how can I do it?

Thank you
in Cockpit, Dashboard and Console by (180 points)

1 Answer

+1 vote

Hello 46mevcrk,

You have to use a parameter in your dataset. You have to transform your dataset in this way: Select * From Table where email like '$P{parameter}%'; where $P{parameter} will be your input string (e.g.: Lo). Remember also to add the url parameter in the Parameters section of your dataset and to use the type Raw or Generic (in this way $P{parameter} will be replaced with Lo and not with 'Lo').

If instead you want to use like input string the complete value Lo% you can simply use a dataset like this Select * From Table where email like $P{parameter} where parameter should be now a Sting type parameter (in order to automatically add quotation marks).

I hope you find this information useful, but if you were looking for something different, please answer again!

by (3.6k points)
I tried and when I run the dataset preview using the parameter it works fine, but when I run the cockpit that includes the driver it doesn't
I've tried to create a test and it works both with the dataset preview and with the cockpit using a simple list driver. Maybe you have set something wrong. If you provide us more informations on the error (like screenshots, logs,...) and on the way you have setting up the cockpit we can try to help you; with only the generic information that it doesn't work we can't do anything.

If instead you want a professional support you can write at knowage@eng.it.

Hi, this is the general configuration, I bet it is wrong since I'm new to this kind of software.

Dataset:

Analytical driver:

Analytical document:

Thanks again

Hi 46mevcrk,

the configuration you have set seems correct. Have you also associated the driver url name input2 to the parameter url Stringa_input in the dataset configuration section of the cockpit? (see image below)

If yes, can you see if there are some errors in the console clicking on F12?

...