Icon

kn_​example_​if_​switch

Check if column is present and use if-switch accordingly

Using Java and Rule engine and If-Switch to decide if a column is present and active which branch of a workflow should be executed

Iris's original Java ideahttps://forum.knime.com/t/add-column-if-doesnt-exist/8059/3?u=mlauber71 https://forum.knime.com/t/if-rule/13502/2?u=mlauber71 Using Java and Rule engine and If-Switch to decide if a column is present and active which branch of a workflow should be executed A + B present$Column Header$ = "B" => 1if B not present = 0 TopactivebranchB not presentif B not present = 0 Top$Column Header$ = "B" => 1activebranchMax*(has_column_b)Max*(has_column_b) Table Creator ExtractColumn Header Transpose Rule Engine GroupBy Java IF (Table) Java EditVariable (simple) ConstantValue Column Table Creator End IF Java IF (Table) ConstantValue Column Transpose GroupBy Rule Engine Java EditVariable (simple) End IF ExtractColumn Header Table Rowto Variable Table Rowto Variable Iris's original Java ideahttps://forum.knime.com/t/add-column-if-doesnt-exist/8059/3?u=mlauber71 https://forum.knime.com/t/if-rule/13502/2?u=mlauber71 Using Java and Rule engine and If-Switch to decide if a column is present and active which branch of a workflow should be executed A + B present$Column Header$ = "B" => 1if B not present = 0 TopactivebranchB not presentif B not present = 0 Top$Column Header$ = "B" => 1activebranchMax*(has_column_b)Max*(has_column_b)Table Creator ExtractColumn Header Transpose Rule Engine GroupBy Java IF (Table) Java EditVariable (simple) ConstantValue Column Table Creator End IF Java IF (Table) ConstantValue Column Transpose GroupBy Rule Engine Java EditVariable (simple) End IF ExtractColumn Header Table Rowto Variable Table Rowto Variable

Nodes

Extensions

Links