Selecting/filtering rows of a database by different flow variables

Hello KNIME-Team,
I am currently struggeling with implementing a row filter action on a database taking different flow variables into consideration. I want to filter this database by a specific time frame and three string values . This values should be interactively changeable by the user and the workflow should adapt itself automatically. Flow variables are currently implemented via Quickform Input Nodes.
I have three main questions on this topic:
1.) Is it possible to create a global variable with the data type Date_Time ?
2.) How can I implement more than only one flow variable to a specific node?
3.) I have already tried to implement this task with the help of a DB-Query-Node


Only the selection of the date frame works properly with this code. The other values (ID_Cellule, MLFB and QSys_Inspection Order) are not selectable. How can I realize the filtering with this values ? (There is no failure message inside KNIME Console)

I’m thankful for every type of help!

Br,
Oliver

Could you post your WF here we can see details.

DB-Reader-Node “creates” empty data table. But as I know the values, there should be some data in.

I would use one DB Query Reader and


node to join all variables.

2 Likes

Lovely hint! Thanks for that!

Also, you can connect your various configuration nodes in series, since flow variables are carried along in a particular branch of a workflow. This can help you avoid having lots of Merge Variables nodes scattered about your workflow.

2020-04-16 11_42_09-KNIME Analytics Platform

2 Likes

Thanks for that! That is even more elegant than using merging nodes!
Do you also have any suggestions/opinion on my sql statement? Is the syntax correct? Especially concerning implementation of those flow variables within the sql statement?

Can you remove or escape the % characters in your query and see if that helps?

Unfortunately, nothing changed. Any other suggestions?
The thing I don’t understand is that I have already implemented a very similar query, using the same flow variables. This query is working fine and filtering works as it should. When I know try to use the same flow variables to filter a second database, it is not working.

Hi @Oliver_1,
which data type your data are? Your criteria for ID_Cellule, MLFB and QSys_Inspection_Order are all of type string. For e.g. ID_Cellule i assume the type Integer or Long. Thererfore your criteria should become the same type.

BR
Hermann

1 Like

Hi Hermann,
thanks for your help!
All three data types are DB_Type: VARCHAR DB Type name: nvarchar, KNIME Type: String. Now, I could already manage to insert the filtering in column ID_Cellule and MLFB by inserting “” around the column names. Only thing that is still not working is Column QSys_Inspection_Order.
Br,
Oliver

Hi Oliver,
may be it helps if you first fetch data for those table without any filter criteria to see how they look are. Could it be that the data in QSys_Inspection_Order are case sensitive?

BR
Hermann

1 Like

Hi Hermann,
you are right. QSys_Inspection_Order don’t contain in every row a String value. A lot of columns are marked with a question marked (Missing value). How can I implemented this the case, that there could either a string or a “missing value” into my filtering?
Thank you very much for your support!
Br,
Oliver

Hi Oliver,
within your SQL-statement
e.g. where ([column] is null or [column] like ‘%[criteria]%’)

BR
Hermann

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.