Lambda Expressions

Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

markdownreferencev1DA42-VJDGguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sqlLambda ExpressionsData 360Data CloudData 360 Query Guide

Created 23 Oct 2026 · Modified 23 Oct 2026 · 1 version

Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/lambda-expressions.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

Lambda Expressions

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Lambda expressions are anonymous functions you pass as arguments to higher-order functions such as ARRAY_TRANSFORM and ARRAY_FILTER. They enable element-wise operations on arrays without writing separate function definitions.

  • <param1>, <param2>, ...: One or more parameter names that represent the elements from the input arrays. The number of parameters must match the number of array arguments passed to the function.
  • <expression>: Any valid SQL expression that uses the parameters. The expression is evaluated once for each element (or tuple of elements) in the input arrays.
  • Lambda expressions can only be used as arguments to functions that accept them, such as ARRAY_TRANSFORM and ARRAY_FILTER.
  • The parameter names are local to the lambda and don’t conflict with column names in the outer query.
  • Lambda expressions can’t reference columns or variables from the outer query scope.
  • The return type of the lambda expression is inferred from the expression. If the expression returns only NULL, you must cast it to a specific type.
  • Data 360 uses the Python / DuckDB-style lambda syntax (lambda x: expr), not the Spark / Snowflake-style arrow syntax (x -> expr).

Use a single parameter when operating on one array.

Returns [2, 4, 6].

Use multiple parameters when operating on multiple arrays in parallel.

Returns [11, 22, 33].

Use CASE expressions within lambdas for conditional transformations.

Returns [4, 5, 6].

Return a boolean expression to filter array elements.

Returns [2, 4, 6].

Lambdas work with any data type.

Returns ["HELLO!", "WORLD?"].

Read this document as markdown — the same bytes an agent receives.