Output Router

Modified on Mon, 22 Sep at 4:29 PM

Summary

The Output Router block conditionally routes all data into a single numbered output based on a formula that is evaluated over the entire dataset connected to the test input. Unlike the If Then Split (True/False) block, you can configure multiple numbered outputs (1, 2, 3, …) in the block options and the formula must return an integer ≥ 1 that selects which output receives the data.


The outputs that are not selected are halted — halted branches are not executed at all and any downstream blocks connected (directly or indirectly) to those halted outputs will not run. There are no side effects from halted branches.



How does it work?

  • test (mandatory) — connect a dataset here. The formula is evaluated once on the complete dataset provided to test.
  • data (optional) — if connected, the dataset coming from data (instead of test) is routed to the selected output. The test input is still always used for evaluating the formula.
  • Formula — configured in the block options. Must return an integer value 123, … corresponding to the configured outputs.


Halting Behavior

Any output that is not chosen by the formula is marked halted. Halted branches are not executed and produce no side effects; downstream blocks connected to them will not run.


Options

Outputs

Configure how many numbered outputs the block exposes (e.g., enter 5 to create outputs 15). The formula result must map to one of these outputs (an integer starting at 1).


Formula

Enter a single expression that is evaluated against the entire dataset connected to test. The expression must evaluate to an integer ≥ 1 which selects the corresponding output. Use Omniscope’s aggregate and SUBSET functions to compute totals, means, medians, counts, etc., over the whole dataset or over specific subsets.


Example 1 — Route by total sales for a region

This example routes all the data into one of four outputs depending on the total sales in "Region A":

IF( SUBSET_SUM([Sales], SUBSET([Region], "Region A", "=")) <= 100000, 1, IF( SUBSET_SUM([Sales], SUBSET([Region], "Region A", "=")) <= 500000, 2, IF( SUBSET_SUM([Sales], SUBSET([Region], "Region A", "=")) <= 1000000, 3, 4 ) ) )

  • Output 1: Region A total sales ≤ 100,000
  • Output 2: Region A total sales > 100,000 and ≤ 500,000
  • Output 3: Region A total sales > 500,000 and ≤ 1,000,000
  • Output 4: Region A total sales > 1,000,000

Because the formula is evaluated on the full test dataset, the entire dataset (or the data input if connected) will be routed in whole to the single output selected above.


Example 2 — Simple two-way routing using mean sales

Route into output 1 when the company-wide mean sales are low, otherwise route to output 2:

IF( SUBSET_MEAN([Sales]) < 100000, 1, 2 )

  • Output 1: company average sales < 100,000
  • Output 2: company average sales ≥ 100,000


Notes on SUBSET usage

  • Use SUBSET(field, value, op) (and combinations like INTERSECTIONUNION where needed) to define subsets, and pass that subset as the second argument to SUBSET_* aggregate functions (for example SUBSET_SUMSUBSET_MEANSUBSET_MEDIANSUBSET_COUNTSUBSET_UNIQUECOUNT, etc.).
  • These SUBSET-based aggregates compute a single aggregate value for the specified subset — which makes them suitable for use in the Output Router’s dataset-level formula.


Outputs

  • 1, 2, 3, … — numbered outputs configured in the block options. The result of the formula (an integer starting at 1) determines which single output receives the data (either the test dataset or the data dataset if connected).
  • All other outputs are halted — their downstream workflows do not execute.


Examples summary

  • Use SUBSET_SUMSUBSET_MEANSUBSET_MEDIANSUBSET_COUNT, etc., to compute dataset-level statistics and choose an output number.
  • Remember: the formula is run once on the complete test dataset (or on the subset defined inside it) and all the routed data is sent to the single selected output.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article