The Query Result To Scalar orchestration component allows you to query a table and return a scalar value. This value can then be mapped to a project or pipeline variable for use in other pipeline components.This component is the scalar equivalent of the Query Result To Grid component.
Basic: This mode will build a query for you using settings from the Data Source, Data Selection, and Data Source Filter parameters. In most cases, this mode will be sufficient.
Advanced: This mode will require you to write an SQL-like query to call data from Snowflake. The available fields and their descriptions are documented in the data model.
The Snowflake database. The special value [Environment Default] uses the database defined in the environment. Read Databases, Tables and Views - Overview to learn more.
The Snowflake schema. The special value [Environment Default] uses the schema defined in the environment. Read Database, Schema, and Share DDL to learn more.
Select columns to sort rows by. When sorting rows by multiple columns, sorting is applied in the order you select the columns. The sort order is shown in this property when you finish selecting columns.
Input Column Name: Select an input column. The available input columns vary depending upon the data source.
Qualifier:
Is: Compares the column to the value using the comparator.
Not: Reverses the effect of the comparison, so “Equals” becomes “Not equals”, “Less than” becomes “Greater than or equal to”, etc.
Comparator: Choose a method of comparing the column to the value. Possible comparators include: “Equal to”, “Greater than”, “Less than”, “Greater than or equal to”, “Less than or equal to”, “Like”, “Null”. “Equal to” can match exact strings and numeric values, while other comparators, such as “Greater than” and “Less than”, will work only with numerics. The “Like” operator allows the wildcard character % to be used at the start and end of a string value to match a column. The Null operator matches only null values, ignoring whatever the value is set to. Not all data sources support all comparators, meaning that it is likely that only a subset of the above comparators will be available to choose from.
Value: The value to be compared.
To use grid variables, select the Use Grid Variable checkbox at the bottom of the Filter Conditions dialog.
This property opens an editor for you to write an SQL query manually instead of setting parameters one at a time. You can also prompt Maia Team to write the query for you—ensure your instructions are clear and contextual.This property is only available when Mode is set to Advanced.
Do not end SQL statements with a semicolon in this component.
Examples:Single scalar, e.g. count of movies:
SELECT COUNT(*) FROM my_database.my_schema.movies
Single value with a filter:
SELECT MAX(release_year) FROM my_database.my_schema.movies WHERE genre = 'Comedy'
Multiple columns → multiple scalar variables:
SELECT COUNT(*) AS total_movies, AVG(rating) AS avg_rating, MAX(box_office) AS top_grossingFROM my_database.my_schema.moviesWHERE release_year = 2025
Scalar results from the SQL query can be mapped to project and pipeline variables.Use the Input Column Name drop-down to select a scalar returned by the query. Use the Scalar Variable Name drop-down to select a variable to map the scalar to. Click + to add more mappings.
Variables used in the mapping must be created before this component runs. Read Project and pipeline variables for details of how to create variables.
To use grid variables, select the Use Grid Variable checkbox at the bottom of the Scalar Variable Mapping dialog.
Basic: This mode will build a query for you using settings from the Data Source, Data Selection, and Data Source Filter parameters. In most cases, this mode will be sufficient.
Advanced: This mode will require you to write an SQL-like query to call data from Databricks. The available fields and their descriptions are documented in the data model.
Select a Databricks Unity Catalog. The special value [Environment Default] uses the catalog defined in the environment. Selecting a catalog will determine which databases are available in the next parameter.
The Databricks schema. The special value [Environment Default] uses the schema defined in the environment. Read Create and manage schemas to learn more.
Select columns to sort rows by. When sorting rows by multiple columns, sorting is applied in the order you select the columns. The sort order is shown in this property when you finish selecting columns.
Input Column Name: Select an input column. The available input columns vary depending upon the data source.
Qualifier:
Is: Compares the column to the value using the comparator.
Not: Reverses the effect of the comparison, so “Equals” becomes “Not equals”, “Less than” becomes “Greater than or equal to”, etc.
Comparator: Choose a method of comparing the column to the value. Possible comparators include: “Equal to”, “Greater than”, “Less than”, “Greater than or equal to”, “Less than or equal to”, “Like”, “Null”. “Equal to” can match exact strings and numeric values, while other comparators, such as “Greater than” and “Less than”, will work only with numerics. The “Like” operator allows the wildcard character % to be used at the start and end of a string value to match a column. The Null operator matches only null values, ignoring whatever the value is set to. Not all data sources support all comparators, meaning that it is likely that only a subset of the above comparators will be available to choose from.
Value: The value to be compared.
To use grid variables, select the Use Grid Variable checkbox at the bottom of the Filter Conditions dialog.
This property opens an editor for you to write an SQL query manually instead of setting parameters one at a time. You can also prompt Maia Team to write the query for you—ensure your instructions are clear and contextual.This property is only available when Mode is set to Advanced.
Do not end SQL statements with a semicolon in this component.
Examples:Single scalar, e.g. count of movies:
SELECT COUNT(*) FROM my_catalog.my_schema.movies
Single value with a filter:
SELECT MAX(release_year) FROM my_catalog.my_schema.movies WHERE genre = 'Comedy'
Multiple columns → multiple scalar variables:
SELECT COUNT(*) AS total_movies, AVG(rating) AS avg_rating, MAX(box_office) AS top_grossingFROM my_catalog.my_schema.moviesWHERE release_year = 2025
Scalar results from the SQL query can be mapped to project and pipeline variables.Use the Input Column Name drop-down to select a scalar returned by the query. Use the Scalar Variable Name drop-down to select a variable to map the scalar to. Click + to add more mappings.
Variables used in the mapping must be created before this component runs. Read Project and pipeline variables for details of how to create variables.
To use grid variables, select the Use Grid Variable checkbox at the bottom of the Scalar Variable Mapping dialog.
Basic: This mode will build a query for you using settings from the Data Source, Data Selection, and Data Source Filter parameters. In most cases, this mode will be sufficient.
Advanced: This mode will require you to write an SQL-like query to call data from Redshift. The available fields and their descriptions are documented in the data model.
Select the table schema. The special value [Environment Default] uses the schema defined in the environment. For more information on using multiple schemas, read Schemas.
Select columns to sort rows by. When sorting rows by multiple columns, sorting is applied in the order you select the columns. The sort order is shown in this property when you finish selecting columns.
Input Column Name: Select an input column. The available input columns vary depending upon the data source.
Qualifier:
Is: Compares the column to the value using the comparator.
Not: Reverses the effect of the comparison, so “Equals” becomes “Not equals”, “Less than” becomes “Greater than or equal to”, etc.
Comparator: Choose a method of comparing the column to the value. Possible comparators include: “Equal to”, “Greater than”, “Less than”, “Greater than or equal to”, “Less than or equal to”, “Like”, “Null”. “Equal to” can match exact strings and numeric values, while other comparators, such as “Greater than” and “Less than”, will work only with numerics. The “Like” operator allows the wildcard character % to be used at the start and end of a string value to match a column. The Null operator matches only null values, ignoring whatever the value is set to. Not all data sources support all comparators, meaning that it is likely that only a subset of the above comparators will be available to choose from.
Value: The value to be compared.
To use grid variables, select the Use Grid Variable checkbox at the bottom of the Filter Conditions dialog.
This property opens an editor for you to write an SQL query manually instead of setting parameters one at a time. You can also prompt Maia Team to write the query for you—ensure your instructions are clear and contextual.This property is only available when Mode is set to Advanced.
Do not end SQL statements with a semicolon in this component.
Examples:Single scalar, e.g. count of movies:
SELECT COUNT(*) FROM my_schema.movies
Single value with a filter:
SELECT MAX(release_year) FROM my_schema.movies WHERE genre = 'Comedy'
Multiple columns → multiple scalar variables:
SELECT COUNT(*) AS total_movies, AVG(rating) AS avg_rating, MAX(box_office) AS top_grossingFROM my_schema.moviesWHERE release_year = 2025
Scalar results from the SQL query can be mapped to project and pipeline variables.Use the Input Column Name drop-down to select a scalar returned by the query. Use the Scalar Variable Name drop-down to select a variable to map the scalar to. Click + to add more mappings.
Variables used in the mapping must be created before this component runs. Read Project and pipeline variables for details of how to create variables.
To use grid variables, select the Use Grid Variable checkbox at the bottom of the Scalar Variable Mapping dialog.
Basic: This mode will build a query for you using settings from the Data Source, Data Selection, and Data Source Filter parameters. In most cases, this mode will be sufficient.
Advanced: This mode will require you to write an SQL-like query to call data from BigQuery. The available fields and their descriptions are documented in the data model.
The Google Cloud project that owns the BigQuery dataset. The special value [Environment Default] uses the Google Cloud project defined in the environment. For more information, read Creating projects.
Select columns to sort rows by. When sorting rows by multiple columns, sorting is applied in the order you select the columns. The sort order is shown in this property when you finish selecting columns.
Input Column Name: Select an input column. The available input columns vary depending upon the data source.
Qualifier:
Is: Compares the column to the value using the comparator.
Not: Reverses the effect of the comparison, so “Equals” becomes “Not equals”, “Less than” becomes “Greater than or equal to”, etc.
Comparator: Choose a method of comparing the column to the value. Possible comparators include:
Less than
Less than or equal to
Equal to
Greater than
Greater than or equal to
Like
Ilike
Similar to
Null
Blank
Null or blank
“Equal to” can match exact strings and numeric values, while other comparators, such as “Greater than” and “Less than”, will work only with numerics. The “Like” operator allows the wildcard character % to be used at the start and end of a string value to match a column. The Null operator matches only null values, ignoring whatever the value is set to. Not all data sources support all comparators, meaning that it is likely that only a subset of the above comparators will be available to choose from.
Value: The value to be compared.
To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.
This property opens an editor for you to write an SQL query manually instead of setting parameters one at a time. You can also prompt Maia Team to write the query for you—ensure your instructions are clear and contextual.This property is only available when Mode is set to Advanced.
Do not end SQL statements with a semicolon in this component.
Examples:Single scalar, e.g. count of movies:
SELECT COUNT(*) FROM my_project.my_dataset.movies
Single value with a filter:
SELECT MAX(release_year) FROM my_project.my_dataset.movies WHERE genre = 'Comedy'
Multiple columns → multiple scalar variables:
SELECT COUNT(*) AS total_movies, AVG(rating) AS avg_rating, MAX(box_office) AS top_grossingFROM my_project.my_dataset.moviesWHERE release_year = 2025
Scalar results from the SQL query can be mapped to project and pipeline variables.Use the Input Column Name drop-down to select a scalar returned by the query. Use the Scalar Variable Name drop-down to select a variable to map the scalar to. Click + to add more mappings.
Variables used in the mapping must be created before this component runs. Read variables for details of how to create variables.
To use grid variables, toggle Use Grid Variable on. For more information, read Grid variables.Toggle Text mode on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read Text mode.