Skip to main content
While importing Alteryx workflows to Prophecy pipelines, Prophecy converts Alteryx functions into equivalent Databricks SQL functions. The following tables list all the Alteryx functions that Prophecy supports and the corresponding Prophecy function they map to in Databricks SQL.

Conditional

When you import conditional Alteryx functions into Prophecy, the logic of your formulas stays the same, but the syntax changes, because Databricks SQL uses 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 Databricks equivalent of Alteryx’s conditional functions.
Alteryx FunctionEquivalent Databricks 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 Databrick 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 Databricks 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 Databricks SQL, this is expressed as a CASE with multiple WHEN … THEN … clauses.

Conversions

Whereas Alteryx has a lot of specialized conversion functions, Databricks SQL tends to use general functions, such as conv for base conversions and cast for changing data types.
Alteryx FunctionEquivalent Databricks SQL FunctionNotes
BinToIntconv()Databricks uses conv for all base conversions in the form conv(expr, from_base, to_base).
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 all base conversions in the form conv(expr, from_base, to_base).
IntToBinbin()Databricks uses bin for all binary conversions.
IntToHexconv()Databricks uses conv for all base conversions in the form conv(expr, from_base, to_base).
ToDegreesdegrees()Exact mapping.
ToNumberregexp_extract()In Databricks, ToNumber is approximated with regexp_extract . This extracts numeric substrings.
ToRadiansradians()Exact mapping.
ToStringcast(columnName as String)ToString becomes CAST to string.

DateTime

Alteryx provides many specialized datetime functions (each handling a specific operation), whereas Databricks SQL relies on a smaller set of general-purpose functions like date_add, date_trunc, and date_format, combined with SQL INTERVAL expressions for finer-grained control.
Alteryx FunctionEquivalent Databricks SQL FunctionNotes
DateTimeAdddate_add()date_add only adds days. Alteryx DateTimeAdd supports units (minutes, hours, months, and so on). For these cases, use ts + INTERVAL 3 HOURS, add_months(ts, n), or date_add(date, nDays) depending on unit.
DateTimeDayday()Exact mapping.
DateTimeDiffdatediff()Returns dates only. For finer units, use expressions such as unix_timestamp/timestampdiff or ts2 - ts1 with INTERVAL.
DateTimeFirstOfMonthdate_trunc()Exact mapping.
DateTimeFormatdate_format(ts, 'pattern')Exact mapping.
DateTimeHourhour()Exact mapping.
DateTimeLastOfMonthlast_day()Exact mapping.
DateTimeMinutesminute()Exact mapping.
DateTimeMonthmonth()Exact mapping.
DateTimeNowcurrent_timestamp()Exact mapping.
DateTimeNowPrecisecurrent_timestamp()Exact mapping.
DateTimeParseto_date()Drops time. Alteryx parse can yield timestamp. Use to_timestamp(str, 'pattern')when you need time.
DateTimeQuarterquarter()Exact mapping.
DateTimeSecondssecond()Exact mapping.
DateTimeTodaycurrent_date()Exact mapping.
DateTimeToUTCto_utc_timestamp(ts, tz)Exact mapping.
DateTimeTrimdate_trunc()Exact mapping.
DateTimeYearyear()Exact mapping.
ToDateto_date()Exact mapping.
ToDateTimeto_timestamp()Outputs full 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 Databricks 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 Databricks SQL relies primarily on native operators (&, |, <<, >>) and a small set of helper functions. The mappings are direct, with no semantic differences.
Alteryx FunctionEquivalent Databricks SQL FunctionNotes
BinaryAnd\&No Binary keyword necessary in Databricks SQL.
BinaryNotbitwise_notNo Binary keyword necessary in Databricks SQL.
BinaryOr|No Binary keyword necessary in Databricks SQL.
BinaryXORbitwiseXORNo Binary keyword necessary in Databricks SQL.
ShiftLeft<<Exact mapping.
ShiftRight>>Exact mapping.

Range and bound functions

There are a number of similarities between how Alteryx and Databricks SQL 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’d use sorting or window functions (ROW_NUMBER() OVER (...)) to achieve the same result.
Alteryx FunctionEquivalent Databricks SQL FunctionNotes
Betweenbetween()In Alteryx, Between([x], 10, 20); in Databricks 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; you replicate the behavior with a CASE expression to “clamp” the value inside a range.
Maxmax()In Databricks SQL, nulls are ignored by default.
MaxIDXarray_max()Applies to arrays rather than datasets. To find the row containing the max value, you’d instead use ORDER BY ... DESC LIMIT 1.
Minmin()In Databricks SQL, nulls are ignored by default.
MinIDXarray_min()Like array_max(), applies to arrays. To find the row with the minimum value, use ORDER BY ... ASC LIMIT 1.

Operators

Alteryx FunctionEquivalent Databricks SQL FunctionNotes
Block comment/*
*/
Exact mapping.
Single-line comment--// does not work in Databricks SQL.
Boolean AND or \&\&AND\&\& is not supported in Databricks SQL. Use AND.
Boolean NOT or !!! is not supported in Databricks SQL. Use NOT.
Boolean OR or ||OR|| is not supported in Databricks SQL. Use OR.
Equality ==, ==In Databricks 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 in Databricks SQL have a number of similarities to those in Alteryx, but with some key differences:
  • Indexing: Alteryx uses zero-based indices; 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 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. In Databricks SQL, element_at(array, index) is 1-based. So GetVal([x], 0) corresponds to element_at(x, 1) in Databricks SQL.
NULLcoalesce()Alteryx allows NULL() as a function that returns a null value. In Databricks SQL, NULL is a literal (no parentheses). To substitute default values for nulls, use coalesce().
TOPNIDXarray_sort(), element_at() and array_position()No direct equivalent. TOPNIDX returns the 0-based index of the Nth largest value from a list. In Databricks SQL, you’d first build an array and then combine sort_array() (descending), element_at() to get the Nth largest value, and array_position() to find its (1-based) index. For top-N rows rather than values within a row, use ORDER BY … LIMIT n or a window function instead.
UrlEncodeurl_encode()Case sensitivity in Databricks SQL follows normal function naming (url_encode, not UrlEncode).

String

String functions in Databricks SQL have many similarities to Alteryx functions, with the following key differences:
  • Indexing: Alteryx string functions are zero-based; Databricks SQL uses 1-based positions.
  • Case sensitivity: Databricks SQL comparisons are case-sensitive unless normalized with lower() or upper().
  • Regex behavior: SQL uses standard Java regex syntax in regexp_* functions; no built-in “count” or “nth match.”
  • Missing functions: DecomposeUnicodeForMatch, STRCSPN, and STRSPN don’t exist; implement via UDF or external logic.
  • Trim and substring: simpler in SQL (trim, substring), but semantics differ slightly with whitespace and indexing.
Alteryx FunctionEquivalent Databricks SQL FunctionNotes
Containscontains()Databricks SQL is case-sensitive by default unless you apply lower() or upper().
CountWordssize() and split()No direct equivalent. In Databricks SQL, split the string into tokens and use size(split(col, ' ')) to count space-delimited words.
DecomposeUnicodeForMatchNo native equivalentNot implemented in Databricks SQL; Unicode normalization would need external processing or Python UDF.
EndsWithcol LIKE '%pattern'SQL uses LIKE; remember to escape special characters and use % wildcards.
FindNthNo native equivalentDatabricks SQL does not have a built-in function to find the position of the Nth occurrence of a substring; you must use nested locate() calls or a regex workaround.
FindStringlocate(substring, col)locate(substring, col) is the Databricks SQL equivalent. It returns the 1-based position of the substring.
GetLeft/Leftsubstring(col, 1, n)Use substring(col, 1, n) in Databricks SQL. Alteryx’s Left/GetLeft is 0-based, but SQL substring positions start at 1.
GetPartelement_at(split(col, ' '), n)Split the string into an array, then use element_at() to retrieve the part. Databricks 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)SQL lacks RIGHT() by default; emulate with substring().
GetWordelement_at(split(col, ' '), n)Split into an array first, then use element_at() (1-based indexing).
Lengthlength()Exact mapping.
LowerCaselower()Exact mapping.
MD5_ASCII,MD5_UNICODE, MD5_UTF8md5()Databricks 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')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)Extracts substring matching regex; returns empty string if no match.
REGEX_Replace, Replace, ReplaceChar, ReplaceFirstregexp_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.
ReverseStringreverse()Exact mapping.
StartsWithcol LIKE 'pattern%'Works with wildcards; case-sensitive by default.
STRCSPNNo native equivalent.Not implemented in Databricks SQL; would require custom UDF.
StripQuotesregexp_replace(col, '["'']', '')Replace quotes with empty string via regex.
STRSPNNo native equivalent.Also unavailable; emulate via regex or Python.
Substringsubstring(col, start, length)Positions are 1-based.
TitleCaseinitcap()Exact mapping.
Trimtrim(col)Use trim() for both sides.
TrimLeftltrim()Exact mapping.
TrimRightrtrim()Exact mapping.
Uppercaseupper()Exact mapping.
UuidCreateuuid()Exact mapping.

Test

Alteryx FunctionEquivalent Databricks SQL FunctionNotes
EqualStrings=Comparisons in SQL are case-sensitive unless you explicitly apply LOWER() or UPPER().
IsEmptycol IS NULL OR length(col) = 0Exact mapping requires two checks. Alteryx IsEmpty() treats both "" and Null as empty; in Databricks SQL, you must test both: col IS NULL OR length(col) = 0.
IsIntegerRLIKE '^[+-]?[0-9]+$'There’s no direct test; use a regular expression to check if the string represents an integer.
IsLowerCasecol = lower(col)True if all characters in the column are lowercase.
IsNullisnullExact mapping.
IsNumbercol RLIKE '^[+-]?([0-9]*[.])?[0-9]+$'cAlteryx detects numerics automatically; in SQL you can approximate it with a regular expression for numeric formats.
IsStringtypeof(col) = 'STRING'Alteryx has explicit string typing; in SQL you check the column’s data type or cast if needed.
IsUpperCasecol = upper(col)True if all characters are uppercase.