Atlas logo
⌘K

Documentation

Getting Started
Data
Maps
Builder
Workflows
Forms
Sharing & Collaboration
Projects & Management
Connections

Formula Fields

Create calculated fields using expressions to automate data calculations

Formula fields allow you to create calculated values based on other fields in your dataset. Use formulas to perform mathematical operations, manipulate text, work with dates, and build conditional logic—all automatically computed for every record.

How Formulas Work

Formulas in Atlas reference other fields in the same record to compute a result. The formula is applied to every record in your dataset, and values update automatically when referenced fields change.

  • Formulas can use functions, operators, and field references
  • Reference fields using the @ symbol followed by the field name: @Price * @Quantity
  • Formula results are read-only and cannot be manually edited

Adding a Formula Field

  1. Open your dataset in the data table view
  2. Click + Add Field in the table header
  3. Select Formula from the field type dropdown
  4. Enter your formula in the expression editor
  5. Choose the output format (Number, Text, Date, etc.)
  6. Click Create to save

Using AI to Generate Formulas

Atlas can generate formulas from natural language descriptions.

  1. Click Generate with AI in the formula editor
  2. Describe what you want to calculate in plain English
  3. Review the generated formula
  4. Click Apply to use it, or refine your description

Example prompts:

  • "Calculate the total by multiplying price and quantity"
  • "Find the number of days between start date and end date"
  • "Combine first name and last name with a space"
  • "Return 'High' if score is above 80, otherwise 'Low'"

Operators

Binary Operators

OperatorDescriptionExample
+Addition or string concatenation@A + @B
-Subtraction@A - @B
*Multiplication@Price * @Quantity
/Division@Total / @Count
^Exponentiation (power)@Base ^ 2
%Remainder (modulo)@Value % 10
//Integer/floor division@Total // @Count
>Greater than@Score > 80
<Less than@Age < 18
>=Greater than or equal@Rating >= 4
<=Less than or equal@Priority <= 2
==Equal to@Status == "Active"
!=Not equal to@Type != "Draft"
&&Logical AND (both must be true)@A > 0 && @B > 0
||Logical OR (at least one must be true)@A == 1 || @B == 1

Unary Operators

OperatorDescriptionExample
+Positive value+@Value
-Negation-@Value
!Logical NOT!@IsArchived

Functions Reference

Math Functions

FunctionDescriptionExample
ABS(value)Absolute valueABS(@Difference)
CEIL(value)Round up to nearest integerCEIL(@Value)
FLOOR(value)Round down to nearest integerFLOOR(@Value)
ROUND(value, decimals)Round to decimal places (default 0)ROUND(@Price, 2)
SQRT(value)Square rootSQRT(@Area)
POW(base, exponent)Raise to powerPOW(@Base, 2)
EXP(value)e raised to powerEXP(@Value)
LOG(value)Natural logarithm (base e)LOG(@Value)
LOG10(value)Base-10 logarithmLOG10(@Value)
MOD(dividend, divisor)Remainder after divisionMOD(@Value, 10)
FACTORIAL(value)Factorial of positive integerFACTORIAL(5)

Trigonometric Functions

FunctionDescriptionExample
SIN(value)Sine (radians)SIN(@Angle)
COS(value)Cosine (radians)COS(@Angle)
TAN(value)Tangent (radians)TAN(@Angle)
ASIN(value)Inverse sine (arcsine)ASIN(@Value)
ACOS(value)Inverse cosine (arccosine)ACOS(@Value)
ATAN(value)Inverse tangent (arctangent)ATAN(@Value)
ATAN2(y, x)Arctangent of y/x with quadrant handlingATAN2(@Y, @X)

Statistical Functions

FunctionDescriptionExample
SUM(*values)Sum of valuesSUM(@Q1, @Q2, @Q3, @Q4)
MIN(*values)Minimum valueMIN(@A, @B, @C)
MAX(*values)Maximum valueMAX(@A, @B, @C)
AVERAGE(*values)Arithmetic meanAVERAGE(@Score1, @Score2)
MEAN(*values)Arithmetic mean (alias)MEAN(@A, @B, @C)
MEDIAN(*values)Median valueMEDIAN(@A, @B, @C)
STDDEV(*values)Sample standard deviationSTDDEV(@A, @B, @C)
VARIANCE(*values)Sample varianceVARIANCE(@A, @B, @C)

Text Functions

FunctionDescriptionExample
CONCATENATE(*values)Join strings togetherCONCATENATE(@First, " ", @Last)
LEN(value)Character countLEN(@Description)
LOWER(value)Convert to lowercaseLOWER(@Email)
UPPER(value)Convert to uppercaseUPPER(@Code)
STRIP(value)Trim whitespace from endsSTRIP(@Name)
SLICE(value, start, end)Extract substringSLICE(@Code, 0, 3)
REPLACE(value, old, new, count)Replace occurrences (count optional)REPLACE(@Phone, "-", "")
CONTAINS(value, search)Check if contains substringCONTAINS(@Tags, "urgent")
FORMAT(fmt, *values)Format string with placeholdersFORMAT("{} - {}", @Code, @Name)
STR(value)Convert to stringSTR(@Number)
TEXT(value)Convert to string (alias)TEXT(@Number)

Regex Functions

FunctionDescriptionExample
REGEX_CONTAINS(value, pattern)Check if matches patternREGEX_CONTAINS(@Email, "@.*\\.com")
REGEX_MATCH(value, pattern)Check if matches from beginningREGEX_MATCH(@Code, "[A-Z]{3}")
REGEX_EXTRACT(value, pattern)Extract first matchREGEX_EXTRACT(@Text, "\\d+")
REGEX_REPLACE(value, pattern, replacement, count)Replace pattern matchesREGEX_REPLACE(@Phone, "\\D", "")

Date & Time Functions

FunctionDescriptionExample
NOW()Current date and timeNOW()
TODAY()Current dateTODAY()
YEAR(value)Extract yearYEAR(@Created)
MONTH(value)Extract month (1-12)MONTH(@Date)
DAY(value)Extract day of monthDAY(@Date)
HOUR(value)Extract hourHOUR(@Timestamp)
MINUTE(value)Extract minuteMINUTE(@Timestamp)
SECOND(value)Extract secondSECOND(@Timestamp)
WEEKDAY(value)Day of week (Monday=0, Sunday=6)WEEKDAY(@Date)
WEEKNUM(value)Week number (ISO 8601)WEEKNUM(@Date)
ADD_MONTHS(value, months)Add months to dateADD_MONTHS(@Start, 3)
ADD_YEARS(value, years)Add years to dateADD_YEARS(@Start, 1)
TIMESTAMP(value)Convert to timestampTIMESTAMP(@DateString)
FROM_UNIX(value)Convert Unix timestamp to dateFROM_UNIX(@UnixTime)
TO_UNIX(value)Convert date to Unix timestampTO_UNIX(@Date)

Time Duration Constants

Use these with date arithmetic:

FunctionDescriptionExample
D()One day@Date + 7 * D()
H()One hour@Time + 2 * H()
M()One minute@Time + 30 * M()
S()One second@Time + 45 * S()
MS()One millisecond@Time + 500 * MS()
W()One week@Date + 2 * W()

Logical Functions

FunctionDescriptionExample
IF(condition, true_value, false_value)Conditional valueIF(@Score > 80, "Pass", "Fail")
CASE(*args)Multiple conditions with valuesCASE(@Score >= 90, "A", @Score >= 80, "B", "C")
NOT(value)Negate booleanNOT(@IsArchived)
TRUE()Boolean true constantTRUE()
FALSE()Boolean false constantFALSE()
BLANK(value)Check if value is missing/nullBLANK(@Notes)
FILL_BLANK(value, fill)Replace missing values (default 0)FILL_BLANK(@Score, 0)

Conversion Functions

FunctionDescriptionExample
INT(value)Convert to integerINT(@Price)
FLOAT(value)Convert to decimalFLOAT(@Text)
STR(value)Convert to stringSTR(@Number)
TEXT(value)Convert to stringTEXT(@Date)
TIMESTAMP(value)Convert to timestampTIMESTAMP(@DateStr)

Constants

FunctionDescriptionValue
PI()Mathematical constant π3.14159...
E()Euler's number2.71828...

Geographic Functions

FunctionDescriptionExample
ST_Area(geom)Area of polygonST_Area(@geometry)
ST_Perimeter(geom)Perimeter of polygonST_Perimeter(@geometry)
ST_Length(geom)Length of lineST_Length(@geometry)
ST_Centroid(geom)Center point of geometryST_Centroid(@geometry)
ST_X(geom)X coordinate of pointST_X(@geometry)
ST_Y(geom)Y coordinate of pointST_Y(@geometry)

Formula Examples

Calculate Total Price

@Unit Price * @Quantity

Apply Discount

@Subtotal * (1 - @Discount / 100)

Full Name from Parts

CONCATENATE(@First Name, " ", @Last Name)

Days Until Due

(@Due Date - TODAY()) / D()

Add 30 Days to Date

@Start Date + 30 * D()

Status Based on Date

IF(@Due Date < TODAY(), "Overdue", IF(@Due Date == TODAY(), "Due Today", "Upcoming"))

Grade from Score (using CASE)

CASE(
  @Score >= 90, "A",
  @Score >= 80, "B",
  @Score >= 70, "C",
  @Score >= 60, "D",
  "F"
)

Handle Missing Values

FILL_BLANK(@Score, 0)

Extract Numbers from Text

REGEX_EXTRACT(@Text, "\\d+")

Format Currency

FORMAT("${:.2f}", @Price)

Calculate Age in Years

(TODAY() - @Birth Date) / D() / 365

Area in Square Kilometers

ST_Area(@geometry) / 1000000

Output Formatting

After creating a formula, configure how results are displayed:

Output TypeFormatting Options
NumberDecimal places, thousands separator
CurrencyCurrency symbol, decimal places
PercentageDecimal places
DateDate format pattern
TextNo additional formatting

Formula Editor Features

The formula editor includes:

  • Syntax highlighting - Functions, fields, numbers, and text are color-coded
  • Autocomplete - Suggestions for functions and field names as you type
  • Error detection - Real-time validation with error messages
  • Field picker - Click @ to browse and insert field references
  • Preview - See calculated results before saving

Troubleshooting

IssueSolution
Formula returns blankCheck that referenced fields have values. Use FILL_BLANK() for fallbacks.
Division by zeroAdd a condition: IF(@Divisor != 0, @Value / @Divisor, 0)
Date calculation wrongEnsure fields are Date type, not Text. Use duration constants like D().
Text not concatenatingUse CONCATENATE() or + operator. Numbers may need STR() conversion.
Unexpected resultsCheck operator precedence. Use parentheses to clarify order.

Formulas vs Other Computed Fields

Field TypeUse Case
FormulaCalculate values from fields in the same record
LookupDisplay values from linked records
AI FieldGenerate content using natural language instructions
Area/PerimeterAuto-calculated from geometry (system fields)
PreviousDownload DataData
NextTroubleshooting GuideData