Metanode port type "flow variable"

Dear KNIMErs,

Another feature request and/or question: Will there be a future metanode with a “flow variable” port type? That’d be quite useful to exploit the metanode concept to the fullest.

Thanks,
E

Yes, just added this two days ago. It will be available in the next minor release (not bug fix release).

Thanks,
Bernd

Wonderful, you guys are simply the best! :slight_smile: Now all that’s missing from my current wishlist are the cartesian join option for the joiner node and the additional aggregation options for the groupby node. Oh, and a table-rather-than-file-based dictionary string replacer and a date/time enabled file reader node, of course… :wink:

Cheers
E

No problem, wen can send you a quote :slight_smile: But seriously, the cartesian join option will come with the new joiner implementation, which is part of v2.2 (already done), the flexible group aggregation methods are in the works but are likely not part of v2.2. The file reader supporting date and time can be worked around easily, so that shouldn’t be so much of a blocker. So we just need to find the resources for the table-based-string-replacer (no immediate plans to add this – should we come back on the quote?)

Regards,
Bernd

Hey all,

I'm running version 2.5.2 of KNIME and I cannot find the cartesian product.

The joiner doesn't support this option. Instead I'm bugged for a joining column pair until I specify one. And a separate node that implements the functionality doesn't seem to exist.

What do I do wrong?

If you take your two tables, and generate a column in each with the same string value using the Rule Engine node, you can then join the two tables together (using Joiner node) on these columns generated by the Rule Engine node to give a Cartesian Join.

Thanks

Simon.

Could you please further explain this a little bit. Why do you need the Rule Engine node? What type of strings should this node generate?

What join mode should be used, the full outer join?

Thanks,

Markus

The idea to use the Rule Engine node is to append a "fake" column with the same value in all rows. Those values are used for joining, in your case a Cartesian product. You could also imagine using the Java Snippet, instead of the Rule Engine node which has been designed for a different purpose. In the configuration you would simply specify a column name and a default value, but no rule - this would generate a new column with the specified value. This step need to be applied to both datasets before you apply the Joiner.

Thank you! It works now. My data come from a database and a CSV file. Surrogate keys in columns are no problem with SQL.

Markus

Hi,

I am a "newbie" to Knime. I have a table where a calculate the total sales per product, and another table where I calculate the overall total sales. Now I try to show the % of total sales per product. I used to do this by a matching the two tables as a "Cartesian Product", and then simply divide the sales per article by totals sales. This topic was disussed above, but I was unable to solve my problem. Could someone please put me on the right track?

Thanks in advance!

Gert

I am not sure that I understand the problem, but I would guess that this problem can be solved either with Pivot or Crosstab node?

I’m not clear if you had trouble generating your Cartesian product or not.
If so, use the rule engine node. You don’t need to add any settings just choose a string for default value. When you run this node you will have a new column with the same string in every row.
Now use the joiner node as full outer join method. Connect both in ports of the join node from this rule engine node. For the matches to join by in the node, instead of the default rowid, choose the newly generated column from the rule engine node in both the left and right join. This will now give you the cartesian product.
Simon.

Hello,

The Rule engine and Join nodes work very well for a Cartesian Product for 2 columns.

However, I would like to do it for many columns, without having to add a Rule Engine and a Joiner for every column of my data table, not to mention a splitter in between.

I tried my best, with a loop, especially the Interval Loop, among others. But I still haven't got a successful conclusion.

Thank you in advance!

Heej

The column list loop start node may be what you need.

 

Simon.

Hello,

Yes, perhaps it is the column list loop start node that helps, but i'm afraid that is not enough at all. Indeed, two columns are first taken, and the cartesian product is applied to it. Then, a third column and this result are taken for the cartesian product, etc. (you apply the Rule Engine node to the first result and on the third column).

This implies that if you are in a loop on columns, you need to take the result of the first iteration and apply the loop to this result, then on the next column, which I doubt that the Column List Loop Start node is able to do..... or am I wrong?

I've tried out some things with the TableRow to Variable Loop Start and the Time Delay Loop Start... but I always face a problem at the end, mainly due to the problem I talked about here above.

Thanks in advance!

Heej

Hello heej,

I made you a workflow which I think is resolving this problem.

You need the data generation and the ensemble plugin for it.

 

ehm.... the flow is a tiny bit complex. But I tried to mark the most important steps with workflow anotations.

 

About the delegating loop (the core of the flow) whatever you feed to the first port will be collected for the outport (as it is the case with other loop ends)

The second port is the feedback port. You need to present a data table with the same configurations as the initial table and this one will be passed back to the loop start of the next iteration.

 

Best, Iris

 

PS: can you next time just start a new topic, because we are currently very off topic ;)