Control / params · All operations

Set a variable from data

A variant of Set parameters

Take a value computed from a table or query, such as a cell, a row or a count, and hold it as a variable.

Status

In arcform

Not built yet

arcform does not do this yet; it would live in how a Protocol runs. Its place on the roadmap

What other tools call it

Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).

Apache Hop (1)
  • Set Variablesread 2026-09-27

    Set variables from the fields of a row, at a chosen scope

dbt-utils (2)
  • Run a SQL query at compile time and return its result columns as a dictionary

  • get_single_valueread 2026-09-27

    Run a SQL query at compile time and return its single value, with a default

Duckle (1)
  • Set Run Variableread 2026-09-25

    compute a value by SQL during the run and expose it as a run variable

KNIME Analytics Platform (2)
Pentaho Data Integration (1)
  • Set Variablesread 2026-09-27

    Set environment variables from a single input row

RapidMiner Studio (5)
SQLMesh (1)
  • @EVALread 2026-09-27

    Evaluate a SQL expression at render time with SQLGlot's executor and emit the result

Talend (1)
  • tContextLoadread 2026-09-27

    Set the values of the active context from an incoming flow, warning on undefined parameters

Background

In DuckDB, the SET VARIABLE statement can assign a variable the result of a query, such as a list of file names read from a table.[1] Apache Hop's Set Variables transform sets variables from the fields of a data row.[2] In KNIME, the Table Row to Variable node uses the first row of a table to define new flow variables, named by its columns and valued by that row's cells.[3]

When to use it

KNIME's Table Row to Variable node converts only the first row of its input table to flow variables, discarding the rows below it.[4] Sort and filter down to the one row you mean before turning it into variables; the first row of an unsorted table is not a choice you made. (Meridian's view) Apache Hop's Set Variables transform accepts one and only one row of data, and fails when it receives two or more.[2]

In Apache Hop, a variable set by the Set Variables transform cannot be used in the same pipeline, because all transforms in a pipeline run in parallel.[2] Apache Hop's Set Variables transform sets a default value when it receives no row, but an empty field sets an empty value, not the default.[2] Decide before the run what an empty result should mean: a sensible default, or a stop. (Meridian's view)

The method

In RapidMiner, a macro is a value that every operator coming after its definition in a process can use, written in the %{macro_name} format.[5] RapidMiner's Extract Macro operator sets the value of a macro from properties of an input data table, including statistics such as the average, minimum or maximum value of one of its attributes.[5]

Apache Hop's Set Variables transform sets each variable at a chosen scope: the whole Java virtual machine, the parent, the grand-parent or the root workflow or pipeline.[2] In DuckDB, a variable assigned from a query is read with getvariable, for example to pass a list of files to read_csv.[1]