Icon

KNIME_​new column based on row logic

workflow example for specific question:https://forum.knime.com/t/new-column-based-on-row-logic/28980/55 April 2021 @takbb Brian Bates The question asked how to create a new column based on valuesfor another column relating to different rows for the same dataitem. This does not specifically answer that question but it does providea solution to the specific problem posed. It demonstrates thatwhilst we cannot necessarily query other rows, if we break theproblem down into "sets", we can perhaps infer the requiredanswer based on the presence or absence of rows in another setof the data The primary set (the actual data) The subset of rows that had No Tree in 2020 By breaking the data into two sets, we can infer therequired information by the join between the twosets Sample DataExclude Tree rowsInclude only 2020 rows"Left Outer" Join on "Node" (A,B,C)Set column to 1Fill in "0" for missing or non-2021 itemsSort output back to desired resultRemove superflous columns Table Creator Row Filter Row Filter Joiner Rule Engine Rule Engine Sorter Column Filter workflow example for specific question:https://forum.knime.com/t/new-column-based-on-row-logic/28980/55 April 2021 @takbb Brian Bates The question asked how to create a new column based on valuesfor another column relating to different rows for the same dataitem. This does not specifically answer that question but it does providea solution to the specific problem posed. It demonstrates thatwhilst we cannot necessarily query other rows, if we break theproblem down into "sets", we can perhaps infer the requiredanswer based on the presence or absence of rows in another setof the data The primary set (the actual data) The subset of rows that had No Tree in 2020 By breaking the data into two sets, we can infer therequired information by the join between the twosets Sample DataExclude Tree rowsInclude only 2020 rows"Left Outer" Join on "Node" (A,B,C)Set column to 1Fill in "0" for missing or non-2021 itemsSort output back to desired resultRemove superflous columns Table Creator Row Filter Row Filter Joiner Rule Engine Rule Engine Sorter Column Filter

Nodes

Extensions

Links