Skip to main content
While importing Alteryx workflows to Prophecy pipelines, Prophecy converts Alteryx functions into equivalent SQL functions for Databricks or BigQuery. The SQL dialect used in imported pipelines is determined by the target platform you select during import. If you import into Databricks, Prophecy generates Databricks SQL. If you import into BigQuery, it generates BigQuery SQL. The following tables list all the Alteryx functions that Prophecy supports and their corresponding SQL functions. If a table does not specify Databricks or BigQuery, functionality is equivalent for both dialects.

Conditional

When you import conditional Alteryx functions into Prophecy, the logic of your formulas stays the same, but the syntax changes, because SQL engines such as Databricks SQL and BigQuery use case expressions instead of IF/IIF/Switch. Prophecy’s import makes these conversions for you. When reading or debugging generated SQL, you should recognize the case functions below as the SQL equivalent of Alteryx’s conditional functions.
Alteryx FunctionEquivalent SQL FunctionNotes
IF c THEN t ELSE f ENDIFcase when then else endcase_when is equivalent to if; endif is equivalent to END.
IF c THEN t ELSEIF c2 THEN t2 ELSE f ENDIFcase when c then t when c2 then t2 else f endcase_when is equivalent to if; endif is equivalent to end. In Alteryx, you chain conditions with elseif. in SQL, each elseif becomes another when … then ….
IIFcase when c then t else f endIn Alteryx, iff serves as a shorthand for if ... else. In SQL, iff is equivalent to a case with one condition.
SWITCHcase when c then t when c2 then t2 ... endIn Alteryx, switch tests one case against several possibilities. In SQL, this is expressed as a case with multiple when … then … clauses.

Conversions

Alteryx provides many specialized conversion functions. SQL engines such as Databricks SQL and BigQuery rely on general-purpose functions like CAST, encoding/decoding functions, and numeric conversions.
  • BigQuery provides safer casting via SAFE_CAST, which returns NULL instead of failing.
  • Databricks: conv() handles many cases, but there is no equivalent in BigQuery.
Alteryx FunctionDatabricks SQLBigQueryNotes
BinToIntconv(expr, from_base, to_base)No direct equivalentBigQuery does not have a general base conversion function like conv. Requires custom logic or UDF.
CharFromIntchar()chr()Function names differ slightly.
CharToIntascii()ascii()Same behavior across engines.
ConvertFromCodePageconvertFromCodePage()No direct equivalentBigQuery does not expose code page conversion functions.
HexToNumberconv()No direct equivalentRequires manual parsing or UDF in BigQuery.
IntToBinbin()No direct equivalentBigQuery lacks built-in binary string conversion.
IntToHexconv()to_hex()BigQuery supports hex conversion via to_hex().
ToDegreesdegrees()degrees()Exact mapping.
ToNumberregexp_extract()SAFE_CAST() or CAST()BigQuery supports direct casting; SAFE_CAST avoids runtime errors.
ToRadiansradians()radians()Exact mapping.
ToStringCAST(col AS STRING)CAST(col AS STRING)Same syntax across engines.

DateTime

Alteryx provides many specialized datetime functions. The SQL mapping depends on the target engine. Databricks SQL and BigQuery both support broad datetime functionality, but they differ in function names, return types, and how they handle truncation, parsing, and time zones.
Alteryx FunctionDatabricks SQLBigQueryNotes
DateTimeAdddate_add() or ts + INTERVAL ... or add_months()DATETIME_ADD(datetime_expression, INTERVAL int64_expression part)BigQuery directly supports DATETIME_ADD across units including MICROSECOND through YEAR. Databricks often requires different functions depending on the unit.
DateTimeDayday()EXTRACT(DAY FROM datetime_expression)BigQuery uses EXTRACT for datetime parts.
DateTimeDiffdatediff()DATETIME_DIFF(end_datetime, start_datetime, part)BigQuery supports multiple parts and counts boundaries; week behavior can vary depending on WEEK, WEEK(MONDAY), or ISOWEEK.
DateTimeFirstOfMonthdate_trunc()DATETIME_TRUNC(datetime_value, MONTH)In BigQuery, truncation is done with DATETIME_TRUNC.
DateTimeFormatdate_format(ts, 'pattern')FORMAT_DATETIME(format_string, datetime_expr)BigQuery uses its own format element syntax.
DateTimeHourhour()EXTRACT(HOUR FROM datetime_expression)BigQuery uses EXTRACT.
DateTimeLastOfMonthlast_day()LAST_DAY(datetime[, MONTH])In BigQuery, LAST_DAY returns a DATE, not a DATETIME.
DateTimeMinutesminute()EXTRACT(MINUTE FROM datetime_expression)BigQuery uses EXTRACT.
DateTimeMonthmonth()EXTRACT(MONTH FROM datetime_expression)BigQuery uses EXTRACT.
DateTimeNowcurrent_timestamp()CURRENT_DATETIME([time_zone])Use CURRENT_DATETIME when the target result should stay a DATETIME. BigQuery supports an optional time zone argument.
DateTimeNowPrecisecurrent_timestamp()CURRENT_DATETIME([time_zone])BigQuery DATETIME includes fractional seconds in the returned value, but this is still a DATETIME, not a timestamp.
DateTimeParseto_date() or to_timestamp()PARSE_DATETIME(format_string, datetime_string)BigQuery has a direct parser for DATETIME; format string positions must match the input string.
DateTimeQuarterquarter()EXTRACT(QUARTER FROM datetime_expression)BigQuery uses EXTRACT.
DateTimeSecondssecond()EXTRACT(SECOND FROM datetime_expression)BigQuery uses EXTRACT.
DateTimeTodaycurrent_date()CURRENT_DATE()
DateTimeToUTCto_utc_timestamp(ts, tz)
DateTimeTrimdate_trunc()DATETIME_TRUNC(datetime_value, granularity)BigQuery supports truncation to date and time granularities. (Google Cloud Documentation)
DateTimeYearyear()EXTRACT(YEAR FROM datetime_expression)BigQuery uses EXTRACT.
ToDateto_date()EXTRACT(DATE FROM datetime_expression) or DATE(datetime_expression)
ToDateTimeto_timestamp()PARSE_TIMESTAMP(format, timestamp_string)

Math

Alteryx offers a large catalog of dedicated math functions, many of which map directly to Databricks SQL. Most Alteryx functions have 1:1 equivalents, with a few cases (random integers, logs) requiring light SQL expressions to reproduce exact behavior.
Alteryx FunctionEquivalent SQL FunctionNotes
ABSabs()Exact mapping.
ACOSacos()Exact mapping.
ASINasin()Exact mapping.
ATANatan()Exact mapping.
ATAN2atan2()Exact mapping.
Averageavg()avg ignores nulls. Use AVG(col) with COALESCE(col, 0) to treat nulls as 0.
AverageNonNullavg()avg ignores nulls by default.
CEILceil()Exact mapping.
COScos()Exact mapping.
COSHcosh()Exact mapping.
DISTANCEhaversine()Exact mapping.
EXPexp()Exact mapping.
FACTORIALfactorial()Exact mapping.
FLOORfloor()Exact mapping.
LOGln()Alteryx LOG() returns the natural log (ln). In SQL, ln(x) is the natural log and log10(x) is base-10. Databricks SQL also supports arbitrary bases via log(base, x).
LOG10log10()Exact mapping..
MedianmedianExact mapping.
Modmod()Exact mapping.
PIpi()Exact mapping.
POWpow()Exact mapping.
RANDrand()Exact mapping.
RandIntrand()Alteryx RandInt returns an integer in an inclusive range. Databricks rand() returns a DOUBLE drawn uniformly from the interval [0, 1), meaning it can return 0 but will never return 1. To mimic RandInt(low, high) exactly, use cast(floor(rand() * (high - low + 1)) + low as int).
Roundround()Exact mapping.
SINsin()Exact mapping.
SINHsinh()Exact mapping.
SQRTsqrt()Exact mapping.
TANtan()Exact mapping.
TANHtanh()Exact mapping.

Bitwise

Alteryx uses named bitwise functions (such as BinaryAnd and BinaryOr), while SQL relies primarily on native operators (&, |, <<, >>) and a small set of helper functions. The mappings are direct, with no semantic differences.
Alteryx FunctionEquivalent SQL FunctionNotes
BinaryAnd\&No Binary keyword necessary in SQL.
BinaryNotbitwise_notNo Binary keyword necessary in SQL.
BinaryOr|No Binary keyword necessary in SQL.
BinaryXORbitwiseXORNo Binary keyword necessary in SQL.
ShiftLeft<<Exact mapping.
ShiftRight>>Exact mapping.

Range and bound functions

There are a number of similarities between how Alteryx and SQL engines in terms of range and bound functions, but also some important differencees:
  • between works directly; syntax just shifts to SQL form.
  • Bound requires an explicit case statement.
  • Max and Min are direct equivalents.
  • MaxIDX and MinIDX in Alteryx identify the position of a value, but in Databricks SQL you use sorting or window functions (row_number() over (...)) to achieve the same result.
Alteryx FunctionEquivalent Databricks SQL FunctionEquivalent BigQuery SQL FunctionNotes
Betweenbetween()betweenIn Alteryx, Between([x], 10, 20); in SQL, x between 10 and 20.
Boundcase when x < min then min when x > max then max else x endcase when x < min then min when x > max then max else x endBigQuery, like Databricks SQL, has no single bound function; use a case expression to clamp the value inside a range.
Maxmax()max()Exact mapping. BigQuery ignores nulls by default.
MaxIDXarray_max()array_max()In both engines, this applies to arrays rather than datasets. To find the row containing the max value, use order by ... desc limit 1 or a window function.
Minmin()min()Exact mapping. In BigQuery, nulls are ignored by default.
MinIDXarray_min()array_min()Like MaxIDX, this applies to arrays rather than datasets. To find the row with the minimum value, use order by ... asc limit 1 or a window function.

Operators

Alteryx FunctionEquivalent SQL FunctionNotes
Block comment/*
*/
Exact mapping.
Single-line comment--// does not work in SQL.
Boolean AND or \&\&AND\&\& is not supported in SQL. Use AND.
Boolean NOT or !!! is not supported in SQL. Use NOT.
Boolean OR or ||OR|| is not supported in SQL. Use OR.
Equality ==, ==In SQL, equality is expressed as =, not ==.
Non-equality !=!=Exact mapping.
Greater than, greater than or equal to, less than, less than or equal to>, >=, <, <=Exact mapping.
Addition, Subtraction, Multiplication, Division+, -, *, /Exact mapping.
Parentheses( )Exact mapping.
value ININExact mapping.
value NOT INNOT INExact mapping.

Specialized

Specialized functions have similar conceptual mappings across SQL engines, but differences arise in indexing, null handling, and how arrays are processed. These differences are especially important when translating positional logic from Alteryx.
  • Indexing: Alteryx uses zero-based indices. BigQuery arrays are 0-based (using OFFSET), but Databricks SQL arrays are 1-based.
  • Null handling: NULL() is a callable function in Alteryx, but a literal in SQL.
  • TOPNIDX: In Alteryx it finds the position of the top N value; in SQL you’ll use sorting or row_number() to replicate.
Alteryx FunctionEquivalent Databricks SQL FunctionEquivalent BigQuery SQL FunctionNotes
Coalescecoalesce()coalesce()Exact mapping across engines.
GetValelement_at()array[...] [offset(index)]Alteryx uses 0-based indexing. Databricks SQL arrays are 1-based (element_at(x, 1) = first element). BigQuery arrays use 0-based indexing with offset, so getval(x, 0)x[offset(0)].
NULLcoalesce() or NULL literalcoalesce() or NULL literalFor both dialects, NULL is a literal (not a function). Use coalesce() to replace nulls.
TOPNIDXarray_sort(), element_at() and array_position()ARRAY_SORT(), ARRAY_REVERSE(), OFFSET, ARRAY_POSITION() (or workaround)No direct equivalent. In BigQuery, you typically sort an array, optionally reverse it for descending order, then use OFFSET(n-1) to access the Nth value. Finding position may require ARRAY_POSITION() or additional logic.
UrlEncodeurl_encode()No direct equivalent.BigQuery does not have a built-in url_encode function; requires UDF or external processing.

String

Key differences across SQL engines:
  • Indexing: Both Databricks SQL and BigQuery use 1-based indexing (Alteryx is 0-based).
  • Case sensitivity: Both engines are case-sensitive by default.
  • Regex behavior:
    • Databricks: Java regex
    • BigQuery: RE2 (no backtracking, fewer advanced features)
  • Function coverage: Some Alteryx string functions have no direct equivalent and require workarounds or UDFs.
  • Substring & trimming: Similar core functions exist, but syntax and edge-case behavior may differ slightly.
AlteryxDatabricks SQLBigQueryNotes
Containscontains()STRPOS(col, substring) > 0Databricks SQL is case-sensitive by default unless you apply lower() or upper(). BigQuery does not have a contains() function; use STRPOS.
CountWordssize() and split()ARRAY_LENGTH(SPLIT(col, ' '))No direct equivalent in SQL. For Databricks, split the string into tokens and use size(split(col, ' ')) to count space-delimited words. BigQuery has equivalent functionality but different function names.
DecomposeUnicodeForMatchNo native equivalentNo native equivalentNot implemented in SQL; Unicode normalization would need external processing or Python UDF.
EndsWithcol LIKE '%pattern'col LIKE '%pattern'SQL uses LIKE; remember to escape special characters and use % wildcards.
FindNthNo native equivalentNo native equivalentRequires workaround in both engines.
FindStringlocate(substring, col)STRPOS(col, substring)locate(substring, col) is the Databricks SQL equivalent. It returns the 1-based position of the substring. BigQuery returns 1-based position; 0 if not found.
GetLeft/Leftsubstring(col, 1, n)substr(col, 1, n)Alteryx’s Left/GetLeft is 0-based, but SQL substring positions start at 1. Databricks and BigQuery have equivalent functions with slightly different names.
GetPartelement_at(split(col, ' '), n)split(col, ' ')[offset(n-1)]Split the string into an array, then use element_at() to retrieve the part. SQL arrays are 1-based: GetPart(col, n)element_at(split(col, ' '), n+1) if Alteryx’s index is 0-based.
GetRight/Rightsubstring(col, length(col)-n+1, n)substring(col, length(col)-n+1, n)SQL lacks RIGHT() by default; emulate with substring().
GetWordelement_at(split(col, ' '), n)SPLIT(col, ' ')[OFFSET(n-1)]Split into an array first, then use element_at() (1-based indexing). BigQuery arrays are 0-based with OFFSET; this is a key difference from Databricks.
Lengthlength()length()Exact mapping.
LowerCaselower()lower()Exact mapping.
MD5_ASCII,MD5_UNICODE, MD5_UTF8md5()md5()SQL does not distinguish between ASCII, Unicode, or UTF-8 variants in its hash functions. md5() is the single equivalent for md5_ascii, md5_unicode, and md5_utf8.
PadLeftlpad(col, n, 'char')LPAD()Exact mapping.
PadRightrpad(col, n, 'char'RPAD()Exact mapping.
REGEX_CountMatchessize(split(col, regex)) - 1ARRAY_LENGTH(REGEXP_EXTRACT_ALL<br/>(col, regex))No built-in counter; emulate with split() and size(). BigQuery has REGEXP_EXTRACT_ALL, making this cleaner.
REGEX_Matchregexp_extract(col, regex, 0)REGEXP_EXTRACT(col, regex)Databricks extracts substring matching regex; returns empty string if no match. BigQuery uses RE2 syntax; some patterns supported in Databricks may fail.
REGEX_Replace, Replace, ReplaceChar, ReplaceFirstregexp_replace(col, pattern, replacement)REGEXP_REPLACE(col, pattern, replacement)Use regexp_replace(col, pattern, replacement). Databricks SQL uses one function for all regex and substring replacements; it replaces all matches by default. There is no built-in “replace only the first occurrence” variant without extra logic. BigQuery uses RE2 syntax.
ReverseStringreverse()reverse()Exact mapping.
StartsWithcol LIKE 'pattern%'col LIKE 'pattern%'Works with wildcards; case-sensitive by default.
STRCSPNNo native equivalent.No native equivalent.Not implemented in Databricks SQL; would require custom UDF.
StripQuotesregexp_replace(col, '["'']', '')regexp_replace(col, '["'']', '')Replace quotes with empty string via regex.
STRSPNNo native equivalent.No native equivalent.Also unavailable; emulate via regex or Python.
Substringsubstring(col, start, length)substr(col, start, length)Positions are 1-based; function name differs (substr vs. substring).
TitleCaseinitcap()initcap()Exact mapping.
Trimtrim(col)TRIM()Use trim() for both sides.
TrimLeftltrim()ltrim()Exact mapping.
TrimRightrtrim()rtrim()Exact mapping.
Uppercaseupper()upper()Exact mapping.
UuidCreateuuid()generate_uuid()Exact mapping.