Redivis Documentation
API DocumentationRedivis Home
  • Introduction
  • Redivis for open science
    • FAIR data practices
    • Open access
    • Data repository characteristics
    • Data retention policy
    • Citations
  • Guides
    • Getting started
    • Discover & access data
      • Discover datasets
      • Apply to access restricted data
      • Create a study
    • Analyze data in a workflow
      • Reshape data in transforms
      • Work with data in notebooks
      • Running ML workloads
      • Example workflows
        • Analyzing large tabular data
        • Create an image classification model
        • Fine tuning a Large Language Model (LLM)
        • No-code visualization
        • Continuous enrollment
        • Select first/last encounter
    • Export & publish your work
      • Export to other environments
      • Build your own site with Observable
    • Create & manage datasets
      • Create and populate a dataset
      • Upload tabular data as tables
      • Upload unstructured data as files
      • Cleaning tabular data
    • Administer an organization
      • Configure access systems
      • Grant access to data
      • Generate a report
      • Example tasks
        • Emailing subsets of members
    • Video guides
  • Reference
    • Your account
      • Creating an account
      • Managing logins
      • Single Sign-On (SSO)
      • Workspace
      • Studies
      • Compute credits and billing
    • Datasets
      • Documentation
      • Tables
      • Variables
      • Files
      • Creating & editing datasets
      • Uploading data
        • Tabular data
        • Geospatial data
        • Unstructured data
        • Metadata
        • Data sources
        • Programmatic uploads
      • Version control
      • Sampling
      • Exporting data
        • Download
        • Programmatic
        • Google Data Studio
        • Google Cloud Storage
        • Google BigQuery
        • Embedding tables
    • Workflows
      • Workflow concepts
      • Documentation
      • Data sources
      • Tables
      • Transforms
        • Transform concepts
        • Step: Aggregate
        • Step: Create variables
        • Step: Filter
        • Step: Join
        • Step: Limit
        • Step: Stack
        • Step: Order
        • Step: Pivot
        • Step: Rename
        • Step: Retype
        • Step: SQL query
        • Variable selection
        • Value lists
        • Optimization and errors
        • Variable creation methods
          • Common elements
          • Aggregate
          • Case (if/else)
          • Date
          • DateTime
          • Geography
          • JSON
          • Math
          • Navigation
          • Numbering
          • Other
          • Statistical
          • String
          • Time
      • Notebooks
        • Notebook concepts
        • Compute resources
        • Python notebooks
        • R notebooks
        • Stata notebooks
        • SAS notebooks
        • Using the Jupyter interface
      • Access and privacy
    • Data access
      • Access levels
      • Configuring access
      • Requesting access
      • Approving access
      • Usage rules
      • Data access in workflows
    • Organizations
      • Administrator panel
      • Members
      • Studies
      • Workflows
      • Datasets
      • Permission groups
      • Requirements
      • Reports
      • Logs
      • Billing
      • Settings and branding
        • Account
        • Public profile
        • Membership
        • Export environments
        • Advanced: DOI configuration
        • Advanced: Stata & SAS setup
        • Advanced: Data storage locations
        • Advanced: Data egress configuration
    • Institutions
      • Administrator panel
      • Organizations
      • Members
      • Datasets
      • Reports
      • Settings and branding
    • Quotas and limits
    • Glossary
  • Additional Resources
    • Events and press
    • API documentation
    • Redivis Labs
    • Office hours
    • Contact us
    • More information
      • Product updates
      • Roadmap
      • System status
      • Security
      • Feature requests
      • Report a bug
Powered by GitBook
On this page
  • Absolute value
  • Arithmetic
  • Ceiling
  • Integer divide
  • e ^ x
  • Floor
  • Greatest
  • Is infinity
  • Is NaN
  • Least
  • Log
  • Mod
  • Power
  • Random
  • Round
  • Safe divide
  • Sign
  • Sqrt
  • Truncate

Was this helpful?

Export as PDF
  1. Reference
  2. Workflows
  3. Transforms
  4. Variable creation methods

Math

Last updated 1 year ago

Was this helpful?

Absolute value

Returns the absolute value of a variable –>

ABS(@variable)

Return type

dynamic (input-dependent)

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@variable

true

-

Arithmetic

Compute simple arithmetic (+, -, *, /) –>

(@expression @operator @expression_2)

Return type

dynamic (input-dependent)

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

@operator

any of: +, -, *, /

true

(E.g., +)

@expression_2

true

-

Ceiling

CEILING(@variable)

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@variable

true

-

Integer divide

DIV(@expression, @expression_2)

Return type

integer

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

@expression_2

true

-

e ^ x

EXP(@expression)

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

Floor

FLOOR(@variable)

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@variable

true

-

Greatest

GREATEST(@expression)

Return type

dynamic (input-dependent)

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

Is infinity

IS_INF(@variable)

Return type

boolean

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@variable

true

-

Is NaN

IS_NAN(@variable)

Return type

boolean

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@variable

true

-

Least

LEAST(@expression)

Return type

dynamic (input-dependent)

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

Log

LOG(@expression[, @literal])

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

@literal

false

-

Mod

MOD(@expression, @expression_2)

Return type

integer

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

@expression_2

true

-

Power

POW(@expression, @expression_2)

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

@expression_2

true

-

Random

RAND()

Return type

float

Parameters

Round

ROUND(@expression[, @literal])

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

@literal

false

-

Safe divide

SAFE_DIVIDE(@expression, @expression_2)

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

@expression_2

true

-

Sign

SIGN(@variable)

Return type

integer

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@variable

true

-

Sqrt

SQRT(@expression)

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

Truncate

TRUNC(@expression[, @literal])

Return type

float

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@expression

true

-

@literal

false

-

any ,

or

any ,

or

any ,

Returns the smallest integral value that is not less than the provided value –>

any

Divide two integer values, rounding down any remainder –>

or

any

or

any

Compute the natural exponential of a value –>

or

any ,

Returns the largest integral value that is not greater than the provided value –>

any

Find the largest of several values –>

s or s

any , , , , , ,

Return true if the value is positive or negative infinity, false otherwise. Returns NULL for NULL inputs –>

any ,

Determines whether input value is not a number (NaN) –>

any ,

Find the smallest of several values –>

s or s

any , , , , , ,

Compute the logarithm of a value to a provided base; generates an error if the variable is <= 0. If no base is provided, defaults to natural log –>

or

any ,

any ,

Modulo: compute the remainder of the division of two integers –>

or

any

or

any

Raises a value to a power –>

or

any ,

or

any ,

Generate a pseudo-random float between [0, 1) –>

Rounds a value to the nearest integer (or, if specified, to the provided number of decimal places) –>

or

any ,

any

Equivalent to the divisor operator, but returns null if an error occurs, such as a division by zero error –>

or

any ,

or

any ,

Returns the sign (-1, 0, +1) of a numeric variable –>

any ,

Compute the square root of a value; generates an error if the variable is less than 0 –>

or

any ,

Similar to round, but rounds to the nearest integer whose absolute value is not greater than the absolute value of the provided variable (always rounds towards zero) –>

or

any ,

any

learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
variable
integer
float
variable
literal
integer
float
enum
variable
literal
integer
float
variable
float
variable
literal
integer
variable
literal
integer
variable
literal
integer
float
variable
float
variable
literal
integer
float
date
dateTime
time
string
boolean
variable
integer
float
variable
integer
float
variable
literal
integer
float
date
dateTime
time
string
boolean
variable
literal
integer
float
literal
integer
float
variable
literal
integer
variable
literal
integer
variable
literal
integer
float
variable
literal
integer
float
variable
literal
integer
float
literal
integer
variable
literal
integer
float
variable
literal
integer
float
variable
integer
float
variable
literal
integer
float
variable
literal
integer
float
literal
integer