Can I make this row splitter with less nodes

Hello KNIME Forum,

I have a dataset Temperature Temperature.zip (16.0 KB)

I want to have the temperatures of each year not under each other but next to each other ( in different columns) I managed to do this with many nodes and I want to know if there is a more elegant way to get this done (Check the column aggregation for the final result).
KNIME_RowSplitterEfficiency.knwf (32.0 KB)

Hopefully some knows how to make this workflow more elegant with less nodes!

Hi @StudentEt,

I believe what you are looking for is the Pivoting node.
It’s admittedly quite complex but once you figured it out, it’s an enormously powerful tool.
In your case, you will want to select the month and day as grouping columns, the year as pivoting column and then select e.g. “First” as aggregation on temp.
Tip: In the advanced settings (at the bottom of the dialog) you have some options for specifying the naming scheme of the result columns. In your case, I’d set “Aggregation name” to “Keep original name(s)”.

Cheers,

Adrian

5 Likes

Thank you very much! The only problem now is that the dates are not in chronic order anymore. Is there a way to keep the dates in a chronic all order? So the first row is January 1st 2012 the second row is January 2nd 2012 etc.

Provided your rows were ordered before the pivoting, you can set the “Retain row order” option in the Advanced settings.
Alternatively, you can also use the Sorter after the pivoting to change the row order.

Cheers,
Adrian

2 Likes

You are the best! Thank you very much!

1 Like

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