Two Way table in knime? - knime

I am new to KNIME and I have a question, I have column splitter node that is outputting one column and one row. This will naturally have one value in the cell. I want to feed this value into a column of a table in KNIME. How do I do this?
I Don't see two way tables in KNIME.

You can use the Cross Joiner node to append the constant column. (There is also the Table Row to Variable and Constant Value Column combination if the constant value is one of the primitive types (String, Double, Int).)
You may need the RowID node to replace/restore the row ids.

Related

Grouping with if condition

I've got a table with a number of rows. Let's say it has 2 columns called Value and Value Type. I've got a group on Value Type
Outside the group, I've got 2 rows. 1 for each value type (There's only 2 value types). I want to sum the values for each value type, but the issue appears that I can't reference more than one column.
So I can't do something like this as it's referencing two fields.
=SUM(IIF(Fields!ValueType.Value="Blah",Fields!Value.Value,0))
How do I get around this?
I figured it out. I just needed to use the phase Nothing, rather than 0.

How to Guess schema in Mysqlinput on the fly in Talend

I've build a job that copy data from a mysql db table to b mysql table.
The table columns are the same except sometimes a new column can be added in table a db.
i want to retrieve all the columns from a to b but only those that exists in table b. i was able to put in the query specific select colume statment that exists in table b like:
select coulmn1,column2,columns3... from table a
the issue is if i add a new column in b that matches a the talend job schema in Mysqlinput should be changed as well cause i work with build in type.
Is there a way to force the schema columns during the job running?
If you are using a subscription version of Talend, you can use the dynamic column type. You can define a single column for your input of type "Dynamic" and map it to a column of the same type in your output component. This will dynamically get columns from table a and map them to the same columns in table b. Here's an example.
If you are using Talend Open Studio, things get a little trickier as Talend expects a list of columns for the input and output components that need to be defined at design time.
Here's a solution I put together to work around this limitation.
The idea is to list all table a's columns that are present in table b. Then convert it to a comma separated list of columns, in my example id,Theme,name and store it in a global variable COLUMN_LIST. A second output of the tMap builds the same list of columns, but this time putting single quotes between columns (so as they can be used as parameters to the CONCAT function later), then add single quotes to the beginning and end, like so: "'", id,"','",Theme,"','",name,"'" and store it in a global variable CONCAT_LIST.
On the next subjob, I query table a using the CONCAT function, giving it the list of columns to be concatenated CONCAT_LIST, thus retrieving each record in a single column like so 'value1', 'value2',..etc
Then at last I execute an INSERT query against table b, by specifying the list of columns given by the global variable COLUMN_LIST, and the values to be inserted as a single string resulting from the CONCAT function (row6.values).
This solution is generic, if you replace your table names by context variables, you can use it to copy data from any MySQL table to another table.

Is there a way to get value example from database, that can be inserted to the column in mysql?

I'm working on tool, that will replace values in specified columns with some other values. User specifies needed table columns in config and the tool replaces their values. I can get the type of a column from information.schema. Is there a way to get a valid value for this column? Or I need to specify them by myself for each column type?

SSIS lookup a table with multiple business conditions

I need to do a lookup against a table with different business conditions on each column:
Against the first column is a "natural" lookup (equal).
Against the second column, the lookup is like : if they match, give me the result, if don't match, select the rows with empty fields.
Same thing this for the 3th, 4th, 5th column and eventually you just get one row, and the 6th column of this row is the matching value I need
My question is how to implement this logic against a lookup table with different business conditions on each column. Should I implement this with a store procedure?
I see no reason for a stored procedure. Just implement it in the SQL query used by the Lookup.

add variable number of empty columns to a tablix

I have a tablix with a column group so that it will create a column for that field provided any row has data for that column.
I need to create a version of this report that contains some empty columns on the end.
I want the number of columns to be added to be based on some factor of the non empty columns with some min/max constraints also. (my question is not how to get the number of columns required)
so far i've tried.
1 - adding individual empty columns to the tablix and setting the visibility condition on each column.
a bit long winded and a bit of a faff.
2 - creating another column group and grouping on the same field, this creates
cant vary the number of columns returned.
am i missing a simple way of adding x empty rows or columns to a tablix? where x can be calculated somehow from the values in the dataset.
You will have to fib this scenario in your data. The column-wise grouping works with known data including those falling in the column group value with null values. There is no way to grow your groups without data unless you add some column group footer logic that would be pretty weird.
I would look into producing phantom NULL value records that will push out your columns.