If switch and reading different files

Hi,
I have a scenario where I want to detect duplicate values, and if no duplicate values are found, read one file. If duplicate values ARE detected, read a different file. Is this possible with the Switch nodes? If so, how would it be set up? No Read nodes have an input port, so I’m not sure what to connect the output of my Switch node to.

Thanks!

You can use variables port.

1 Like

Hi @Snowy

I don’t think you need an If Switch node. It is possible to do it using flow variables. if_switch_different_files.knwf (95.1 KB) In this example the Row Filter (choose (no-)duplicate) can be left out, because the Table Row to Variable node expects the output of your scenario (yes or no duplicates).

2 Likes

Here’s another option in case you wanted to play with switches…

4 Likes

You could use the Vernalis Flow Variable IF Switch (Flow Variable Value) node in place of the CASE Switch node and condense the Duplicate Row Filter and Rule Engine to a single node, and make the configuration very simple:

image

image

(Where the ‘Count*(Universe_0_0)’ variable is the column name of whichever column you choose to count on)

Steve

2 Likes

Thanks, Steve - that is quite nice!

1 Like

Thanks @ScottF - we have the equivalent node for ‘normal’ IF Switch too - it saves the almost invariable need for an Edit Variable node to create a variable to control the output port :slight_smile:

(Search for (Flow Variable Value) on the hub and you should find it)

Steve

2 Likes

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