Functions

Version:
2019.3
Last modified: November 11, 2019

Use functions to build expressions that perform a variety of calculations and operations. 

Types of Functions

The following function types are available for transforming and your data. The type of data determines the functions you can use. See Data Types.

Conditional

Conditional functions allow you to perform an action or calculation using an IF statement. Learn more in the Conditional Functions article.

Conversion

Conversion functions convert numbers to strings or strings to numbers. Learn more in the Conversion Functions article.

DateTime

DateTime functions allow you to perform an action or calculation on a date and time value. Learn more in the DateTime Functions article.

File

A file function builds file paths, checks to see if a file exists, or extracts a part of a file path. Learn more in the File Functions article.

Finance

A finance function applies financial algorithms or mathematical calculations. Learn more in the Finance Functions article.

Math

A math function performs mathematical calculations. Learn more in the Math Functions article.

Math: Bitwise

A bitwise function operates on one or more bit patterns or binary numerals at the level of their individual bits. Use a bitwise function to manipulate values for comparisons and calculations. Learn more in the Math:Bitwise Functions article.

Min/Max

A minimum or maximum function finds the smallest and largest value of a set of values. Learn more in the Min/Max Functions article.

Operators

An operator is a character that represents an action. Use an arithmetic operator to perform mathematical calculations or a Boolean operator to work with true/false values. Learn more in the Operators article.

Spatial

A spatial function builds spatial objects, analyzes spatial data, and returns metrics from spatial fields. Learn more in the Spatial Functions article.

Specialized

These functions perform a variety of specialized actions and can be used with all data types. Learn more in the Specialized Functions article.

String

A string function performs operations on text data. Use a string function to cleanse data, convert data to a different format or case, compute metrics about the data, or perform other manipulations. Learn more in the String Functions article.

Test

A test function performs data comparisons. Use a test function to identify the data type of a value, or determine if a value exists. Learn more in the Test Functions article.

The Expression Editor

Functions can be built within the expression editor.

Build an Expression

Use any of these methods to build an expression:

  • Type directly in the expression editor.
  • Click Variables to browse through variables that can be used in the expression. Double-click the variable to add it to the expression editor.
  • As you edit the expression, the editor applies a color coding scheme to its various parts (e.g. functions are gold; variables are fuchsia, operators are magenta, and strings are turquoise, a blue-green) making the parts of the expression easy to distinguish.

    Variables

  • Fields: Data from an incoming connection, or from a column created in a previous expression.
  • Connections from Questions: Values from an Interface tool connected to the Question anchor of a tool with an expression editor, when the tool is used in an app or macro. Use the Question anchor when you want question values to be used as variables in the expression. See Interface tools.
  • Constants: Global variables for a workflow that make it possible to change a value in a single location and have that change apply to the rest of the workflow. See Constants.
  • Click Functions to browse through categories of functions. Double-click the function to add it to the expression editor. 
  • Click Saved Expressions to browse through recent and saved expressions. Double-click the expression to add it to the expression editor.

Save an Expression

  • With an expression in the expression editor, click Save.
  • Type a name for the expression and click OK.

Tools with an Expression Editor

The following tools include an expression editor. Tools that use an expression editor have an additional Input anchor and Question anchor when the tool is used in an app or macro workflow. Use the Interface tools to connect to a Question anchor when you want question values to be used as variables in the expression. See Interface Tools for more information.

Link
Action Tool Icon

Action Tool

Link
Interactive Chart Tool

Interactive Chart Tool

Link
Condition Tool Icon

Condition Tool

Link
Dynamic Rename tool

Dynamic Rename Tool

Link
Error Message Tool Icon

Error Message Tool

Link
Filter Tool Icon

Filter Tool

Link
Box with rows, a plus sign and an arrow pointing downward.

Generate Rows Tool

Link
Message tool

Message Tool

Link
Beaker with liquid and stir-stick.

Multi-Field Formula Tool

Link
Liquid drops falling into a beaker.

Multi-Row Formula Tool

Link
Orange polygon containing globe.

Report Map Tool

Link
Orange polygon with white table with multiple rows.

Table Tool

Link
Test Tool

Test Tool

Was This Helpful?

Need something else? Visit the Alteryx Community or contact support.