Icon

Exercise3

There has been no title set for this workflow's metadata.

Chapter 6 / Exercise 3

In this exercise, we clean up a file from duplicates.
The easiest way would be to use a GroupBy node, group by contract IDs and take only the first item in the group.
A more complex way would be using a group loop.
But we choose the most complex way of all, through a TableRow to Variable Loop Start just to show how the TableRow to Variable Loop works.

Note

Since KNIME has been thought in terms of data table, loops are rarely needed. Before using a loop make sure that a dedicated node for what you have in mind does not exist!

Workflow: Chapter 7/Exercise 3


In this exercise, we clean up a file from duplicates. The easiest way would be to use a GroupBy node, group by contract IDs and take only the first item in the group.

A more complex way would be using a group loop.

But we choose the most complex way of all, through a Table Row to Variable Loop Start just to show how the Table Row to Variable Loop works.

keep only "contract nr"
Column Filter
contract nr are not uniqueRowID on contract nr fails
RowID
now check again uniqueness on "contract nr"
RowID
only 1st row most recent load_date to remove duplicates
Row Filter
Wrong sales file with duplicated contract number. One row is missing the "amount" and "quantity" values.
CSV Reader
filter by "contract nr"
Row Filter
start loop on "contract nr" one by one
Table Row to Variable Loop Start
remove duplicates by grouping on contract nr and using First for aggregation
GroupBy
list of "contract nr"
GroupBy
String to Date&Time
Loop End
sort ascending on load_date
Sorter

Nodes

Extensions

Links