Icon

KNIME_​compare_​rows 2

Initial data setup Find all rows with a matching -ve non-zero amt_diff and create column"Observation" Produce the required output by joinging back to the original data usingRow number as the key Record the differences between attributesby using a coded loop inside ColumnExpressions to compare c1...c5 with"comp_c1...comp_c5" and write the resultto the "col_diffs" column Sample DataGenerate arow numberfor ease ofsorting andjoiningRename "counter"as "Row"put "Row" atcolumn 1Get negative_diffas amt_diff * -1Join all non-zero rowsto all others whereby row A's negative_diff= row B's amt_diff Get rows withnon-zero amt_diffJoin all those "Swing" rowsback to original rowsby joining on Row numberPut back in originalrow orderAll the matching rowsneed to have "Swing"as observationFill in missing"Observation"sas blankcreate "col_diffs"columnLoop column differences with some code!:-OUse regex to rename the attribute columns from the right of the join to comp_c1...comp_c5for comparisons with c1...c5 Table Creator Counter Generation Column Rename Column Resorter Math Formula Joiner Row Filter Joiner Sorter Rule Engine Missing Value String Manipulation Column Expressions Column Rename(Regex) Initial data setup Find all rows with a matching -ve non-zero amt_diff and create column"Observation" Produce the required output by joinging back to the original data usingRow number as the key Record the differences between attributesby using a coded loop inside ColumnExpressions to compare c1...c5 with"comp_c1...comp_c5" and write the resultto the "col_diffs" column Sample DataGenerate arow numberfor ease ofsorting andjoiningRename "counter"as "Row"put "Row" atcolumn 1Get negative_diffas amt_diff * -1Join all non-zero rowsto all others whereby row A's negative_diff= row B's amt_diff Get rows withnon-zero amt_diffJoin all those "Swing" rowsback to original rowsby joining on Row numberPut back in originalrow orderAll the matching rowsneed to have "Swing"as observationFill in missing"Observation"sas blankcreate "col_diffs"columnLoop column differences with some code!:-OUse regex to rename the attribute columns from the right of the join to comp_c1...comp_c5for comparisons with c1...c5Table Creator Counter Generation Column Rename Column Resorter Math Formula Joiner Row Filter Joiner Sorter Rule Engine Missing Value String Manipulation Column Expressions Column Rename(Regex)

Nodes

Extensions

Links