User Tools

Site Tools


transformations:iteratecolumn

ITERATE COLUMN

Category: Workflow / Internal


Description

Iteratively call another module or project and pass the columns of the input dataset to the called module/project, one column per iteration.

The called module (or project) must have the Input action in order to receive a column passed from the calling module. During iterations, the Input action is populated with one column passed from the calling module at a time. The column will be automatically given a specific temporary name that can be used in module calculations, thus making it possible to apply the same calculation logic to many columns with different names.


Use cases

The action allows applying the same calculation logic to all columns of a dataset and is useful for dealing with matrix tables or performing complex data quality checks for multiple columns.


Action settings

SettingDescription
Module/Project to run*Select whether to call a module (within the current project), or an external project (.morph file), then select the
module, or browse to the project file.
Column nameEnter the name that will be assigned to all columns as they are passed to the called module.
ModeChoose whether to just iterate the called module (or project) and not return any results, or iterate and return
columns. Options: Iterate, ignore results or Iterate, append result columns (and select the Result table from
the called module or project; returned columns will be appended side-by-side).
Assign parametersSelect the parameter(s) in the called module (or project) to pass values in through, and enter the associated value(s)* (can be a text/number, or parameter).
Exclude selected columnsCheck to exclude selected columns from being iterated. Select the columns to be skipped and not be sent to the called module.

* Setting can be specified using a parameter.


Remarks

Note that the action automatically gives the columns a specified name when they are passed to the called module. As a result, the Input action of the called module always contains one column with the same name, regardless of what it was called in the calling action. This allows using a workflow designed for one column name to work over all columns in the source dataset.

Optionally, the resulting datasets of the called module can be appended side to side into one tabular dataset. In this case, only the column with the same name as in Input will be returned back to the calling module and renamed back to its original name. Other columns from the result table will be ignored and discarded.


Examples

Mode: Iterate, ignore results — do not return anything from the iterated module, i.e. just run it one or several times. (top image, below)
Mode: Iterate, append result columns — run the module one or several times, return a table (the result dataset) from each iteration, append all result columns into one, which becomes the output of the "Iterate column" action. (bottom image, above)


Community examples


See also

transformations/iteratecolumn.txt · Last modified: 2021/07/15 12:12 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki