Skip to main content
While importing Alteryx workflows to Prophecy pipelines, Prophecy converts Alteryx functions into equivalent SQL functions. The SQL dialect used in imported pipelines is determined by the target platform you select during import (Databricks, BigQuery, or Snowflake). The following tables list all the Alteryx functions that Prophecy supports and their corresponding SQL functions. If a table does not specify Databricks, BigQuery, or Snowflake, functionality is equivalent for all three 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 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 rely on general-purpose casting, encoding and decoding functions, and numeric conversion functions.
  • BigQuery provides safer casting via safe_cast, which returns null instead of failing.
  • Snowflake provides error-handling conversion functions such as try_cast and try_to_number, which return null when conversion fails.
  • Databricks SQL supports conv() for base conversions, but BigQuery and Snowflake do not have the same general-purpose base conversion function.
Alteryx FunctionEquivalent SQL FunctionNotes
BinToIntconv(expr, from_base, to_base)Databricks uses conv for base conversions.
CharFromIntchar()char is equivalent to CharFromInt in Alteryx.
CharToIntascii()ascii is equivalent to CharToInt in Alteryx.
ConvertFromCodePageconvertFromCodePage()Functions are equivalent; note slightly different case in SQL function name.
HexToNumberconv()Databricks uses conv for base conversions.
IntToBinbin()Databricks uses bin for binary conversions.
IntToHexconv()Databricks uses conv for base conversions.
ToDegreesdegrees()Exact mapping.
ToNumberregexp_extract()In Databricks, ToNumber is approximated with regexp_extract. This extracts numeric substrings.
ToRadiansradians()Exact mapping.
ToStringcast(col as string)Converts to a string.

DateTime

Alteryx provides many specialized datetime functions. The SQL mapping depends on the target engine. Databricks SQL, BigQuery, and Snowflake all support broad datetime functionality, but they differ in function names, argument order, return types, format patterns, and time zone behavior.
Alteryx FunctionEquivalent SQL FunctionNotes
DateTimeAdddate_add() or ts + interval ... or add_months()date_add only adds days. For other units, use interval expressions or add_months() depending on the unit.
DateTimeDayday()Exact mapping.
DateTimeDiffdatediff()Returns date differences. For finer units, use timestamp or interval expressions.
DateTimeFirstOfMonthdate_trunc()Exact mapping.
DateTimeFormatdate_format(ts, 'pattern')Formats date or timestamp values as strings.
DateTimeHourhour()Exact mapping.
DateTimeLastOfMonthlast_day()Exact mapping.
DateTimeMinutesminute()Exact mapping.
DateTimeMonthmonth()Exact mapping.
DateTimeNowcurrent_timestamp()Exact mapping.
DateTimeNowPrecisecurrent_timestamp()Exact mapping.
DateTimeParseto_date() or to_timestamp()Use to_timestamp() when the parsed value needs to retain time information.
DateTimeQuarterquarter()Exact mapping.
DateTimeSecondssecond()Exact mapping.
DateTimeTodaycurrent_date()Exact mapping.
DateTimeToUTCto_utc_timestamp(ts, tz)Converts a timestamp from the specified time zone to UTC.
DateTimeTrimdate_trunc()Exact mapping.
DateTimeYearyear()Exact mapping.
ToDateto_date()Converts to a date.
ToDateTimeto_timestamp()Outputs a SQL timestamp.

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

Range and bound functions behave similarly across SQL engines, but differences arise in how arrays, ordering, and positional logic are handled.
  • 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 SQL engines typically use sorting or window functions (row_number() over (...)) to achieve the same result.
Alteryx FunctionEquivalent SQL FunctionNotes
Betweenbetween()In 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 endDatabricks SQL has no single bound function; use a case expression to clamp the value inside a range.
Maxmax()Exact mapping. Nulls are ignored by default.
MaxIDXarray_max()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()Exact mapping. Nulls are ignored by default.
MinIDXarray_min()Like array_max(), this applies to arrays. To find the row with the minimum value, use order by ... asc limit 1.

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 and Snowflake arrays are 0-based, while 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; SQL engines typically use sorting and positional access to replicate this behavior.
Alteryx FunctionEquivalent SQL FunctionNotes
Coalescecoalesce()Alteryx evaluates left-to-right; Databricks SQL follows standard SQL semantics.
GetValelement_at()In Alteryx, GetVal(list, index) retrieves the element at a 0-based index. Databricks SQL arrays are 1-based, so GetVal([x], 0) corresponds to element_at(x, 1).
NULLcoalesce() or NULL literalNULL is a literal in SQL, not a function. Use coalesce() to replace nulls.
TOPNIDXarray_sort(), element_at(), and array_position()No direct equivalent. Use array sorting plus positional lookup to approximate the behavior. For row-level ranking, use order by or window functions.
UrlEncodeurl_encode()Exact mapping.

String

Key differences across SQL engines:
  • Indexing: Databricks SQL arrays are 1-based, while BigQuery and Snowflake arrays are 0-based. Alteryx uses 0-based indexing.
  • Case sensitivity: All three engines are case-sensitive by default unless you normalize with functions such as lower() or upper().
  • Regex behavior:
    • Databricks: Java regex
    • BigQuery: RE2
    • Snowflake: POSIX-style regular expressions
  • Function coverage: Some Alteryx string functions have no direct equivalent and require workarounds or UDFs.
  • Substring & trimming: Similar core functions exist across engines, but syntax and edge-case behavior may differ slightly.
AlteryxEquivalent SQL FunctionNotes
Containscontains()Databricks SQL is case-sensitive by default unless you apply lower() or upper().
CountWordssize(split(col, ' '))Split the string into tokens and count the resulting array elements.
DecomposeUnicodeForMatchNo native equivalentRequires external processing or Python UDF.
EndsWithcol like '%pattern'SQL uses LIKE; remember to escape special characters and use % wildcards.
FindNthNo native equivalentRequires workaround logic.
FindStringlocate(substring, col)Returns the 1-based position of the substring.
GetLeft / Leftsubstring(col, 1, n)SQL substring positions start at 1.
GetPartelement_at(split(col, ' '), n)Databricks SQL arrays are 1-based. GetPart(col, n)element_at(split(col, ' '), n+1) if the Alteryx index is 0-based.
GetRight / Rightsubstring(col, length(col)-n+1, n)SQL lacks a built-in right() equivalent in some contexts; emulate with substring().
GetWordelement_at(split(col, ' '), n)Uses array indexing after split().
Lengthlength()Exact mapping.
LowerCaselower()Exact mapping.
MD5_ASCII, MD5_UNICODE, MD5_UTF8md5()SQL does not distinguish between encoding-specific MD5 variants.
PadLeftlpad(col, n, 'char')Exact mapping.
PadRightrpad(col, n, 'char')Exact mapping.
REGEX_CountMatchessize(split(col, regex)) - 1No built-in counter; emulate with split() and size().
REGEX_Matchregexp_extract(col, regex, 0)Returns the substring matching the regex pattern.
REGEX_Replace, Replace, ReplaceChar, ReplaceFirstregexp_replace(col, pattern, replacement)Replaces all matches by default.
ReverseStringreverse()Exact mapping.
StartsWithcol LIKE 'pattern%'Case-sensitive by default.
STRCSPNNo native equivalentRequires custom UDF or workaround logic.
StripQuotesregexp_replace(col, '["'']', '')Removes quotes using regex replacement.
STRSPNNo native equivalentRequires custom logic.
Substringsubstring(col, start, length)Positions are 1-based.
TitleCaseinitcap()Exact mapping.
Trimtrim(col)Exact mapping.
TrimLeftltrim()Exact mapping.
TrimRightrtrim()Exact mapping.
Uppercaseupper()Exact mapping.
UuidCreateuuid()Exact mapping.