LogoLogo
Back to OsmosDeveloper DocsOsmos BlogWhat's New
  • Welcome to Osmos
  • 👋Getting Started with Osmos
    • Terminology
  • 🎉What's New
  • 🧩Osmos API Reference
  • ⌨️Osmos Chat
  • 👩‍💻Developer Docs
    • Manage API Keys
    • Embedding an Osmos Uploader
    • Embedding Uploader Jobs Table
    • Turning on Advanced Mode Uploader
    • Customizing Uploader Styling
    • Passing Parameterized Fields
    • Configuring Uploader's "Recall" functionality
    • Optional Uploader Settings
    • Uploader Submission Callback
    • Configuring AutoClean for your Uploader
    • Uploader Client-Side Validation
      • Data Validators
      • Checking for Duplicate values in a field
      • Creating Dropdown-Controlled Fields
      • Dynamic Dropdown Options
      • Dropdown Interaction with Validation Functions
    • Validation and Transformation Webhooks
      • OpenAPI Validation Webhook Testing
    • Parser Webhook for file based connectors
  • 🔠Datasets
    • Osmos Datasets
      • Uploading Data to your Table
      • Creating Primary and Foreign keys
      • Osmos Dataset Destination Connector
      • Osmos Dataset Source Connector
      • Dataset Edits
    • Datasets Query Builder
      • Query Builder Metadata
    • Performing Look Ups
      • Performing Joins
        • Types of Joins
  • ⏏️Uploader
    • Creating an Osmos Uploader
      • Testing your Osmos Uploader
    • Uploader Validation Summary
    • Advanced Mode
      • Overview
      • Process
    • Standard Mode
      • Overview
      • AutoClean
      • Process
    • AI AutoMapping
    • Uploaders Page
    • Uploader Details Page
  • 🔀Pipelines
    • Step 1. Select the Source
    • Step 2. Select a Destination
    • Step 3. Map & Transform Data
    • Step 4. Schedule the Pipeline
    • Step 5. Review & Confirm
    • Pipelines Page
    • Pipeline Details Page
  • ⏩Data Transformations
    • AutoMap
    • Column Mapping & Data Cleanup Panel
    • QuickFixes
    • AI Value Mapping
    • AI AutoClean
    • Lookups
      • Performing Lookups
    • SmartFill
    • Formulas
      • Date & Time Formulas
        • DateTime Format Specifiers
        • Timezone specifiers
      • Math Formulas and Operators
      • Logical Formulas & Operators
        • True & False Casting
      • Text Formulas
      • Other Formulas
    • Deduplication
  • ↘️Source Connectors
    • Amazon S3
    • Azure Blob Storage
    • BigQuery
    • Email
    • FTP
    • Google Cloud Storage (GCS)
    • Google Drive
    • Google Sheets
    • HTTP API (Call an Osmos API)
    • HTTP API (Osmos Calls Your API)
    • Osmos Dataset
    • Snowflake
    • Accessing Sources behind firewall
  • ↖️Destination Connectors
    • Amazon S3
    • BigQuery
    • FTP
    • Google Cloud Storage (GCS)
    • Google Drive
    • Google Sheets
    • HTTP API (Call an Osmos API)
    • HTTP API (Osmos Calls Your API)
      • Passing Dynamic Tokens in the API Header
    • MySQL
    • Osmos Dataset
    • PostgreSQL
    • Snowflake
    • Accessing Destinations behind firewall
  • 🗂️Projects
  • ⚙️Administration
    • Email Notifications
  • 🔒Security
  • 📞Support
  • Back to Osmos.io
Powered by GitBook
On this page
  • And &&
  • Equals =
  • IF
  • IFS
  • Switch
  • NotEquals !=
  • Or ||
  • Xor ^
  • Not
  • Contains
  • Iferror
  • Less Than >
  • Less Than or Equal To >=
  • Greater Than <
  • Greater Than or Equal To <=

Was this helpful?

  1. Data Transformations
  2. Formulas

Logical Formulas & Operators

PreviousMath Formulas and OperatorsNextTrue & False Casting

Last updated 1 year ago

Was this helpful?

Many of these formulas feature the boolean True or False values. To learn more about how Osmos handles True/False evaluation and casting, please see .

And &&

Formula

=and(<input 1>, [input 2], ...)

=<input1>&&[input2]

Description

Returns True if every input value or argument is True, otherwise returns False.

Arguments

Argument

Required (Y/N)

Description

Input 1

Y

The first value or condition that you want to evaluate for True or False

Input 2

N

The second value or condition that you want to evaluate for True or False

... Input N

N

The nth value or condition that you want to evaluate for True or False

Examples

Example 1:

=and(equals(5,5), equals(4,4)) = True

=(5=5)&&(4=4) will return True

Example 2:

=and(not($"IsEmployee"), $"NorthAmericaOffice")

=($"IsEmployee"="False")&&($"NorthAmericaOffice"="True")

Equals =

Formula

=equals(<input 1>, [input 2], ...)

=<input1>=[input2]...

Description

Returns True if every input value or argument is equal to each other input, otherwise returns False

Arguments

Argument

Required (Y/N)

Description

Input 1

Y

Value evaluated along with other input values (Input 2...Input N)

Examples

Example 1:

=equals(5, 5, 5) will return True

=5=5=5 will return True

Example 2:

=equals(1,1,2) will return False

=1=1=2 will return False

Example 3:

=equals($"FirstName", "Peter")

=$"FirstName"="Peter"

IF

Formula

=if(<condition>, <value_if_true>, [value_if_false])

=if(<condition>, <then>, [else])

Description

Returns value_if_true if the condition evaluates to True. Otherwise returns value_if_false.

Arguments

Argument

Required (Y/N)

Description

Condition

Y

Statement, value or logical operation evaluated for TRUE or FALSE

value_if_true

Y

Value returned if Condition is TRUE

value_if_false

N

Value returned if Condition is FALSE

Examples

Example 1:

=if(($"PurchaseDate"-currentdate())>30, "Past Due", "OK")

Example 2:

=if(equals($"First Name", "Doe"), $"Last Name", $"First Name") Example 3:

=if(($"Sales"<=0), $"Sales", skip())

IFS

Formula

=ifs(<condition1>, <value_if_true1>, [condition2],[value_if_true2],[condition3],[value_if_true3]...[value_if_false])

Description

Returns value_if_true1 if the condition1 is True. Otherwise the formula continues to look for the first True condition. An IFS can take the place of multiple nested IF conditions. An IFS statement can be ended with a final "value_if_false" statement in the case that a True statement cannot be found. If a "value_if_false" is not specified and a True statement cannot be found, the equation will output null.

Arguments

Argument

Required (Y/N)

Description

Condition1

Y

Statement, value or logical operation evaluated for TRUE or FALSE

value_if_true1

Y

Value returned if Condition is TRUE

Condition2

N

Optional statement, value or logical operation evaluated for TRUE or FALSE

value_if_true2

N

Optional value returned if Condition is TRUE

value_if_false

N

Optional default value output in the case that none of the outlined conditions return true

Examples

Example 1:

=ifs(($"Rating">=4),"Four Stars",($"Rating">=3),"Three Stars","Needs Improvement")

Example 2:

=ifs(($"ProductCategory"=103), "Shirts & Jackets", ($"ProductCategory"=104), "Pants", "Unknown")

Switch

Formula

=switch(<$"Field">, <input1>, <value1>, [input2], [value2]... [default_value])

Description

Returns a value directly corresponding to an input where that input is found in a specified field.

Arguments

Argument

Required (Y/N)

Description

Field

Y

The location of the data to be compared to input values

input1

Y

The input to be compared against the value in a specified field

value1

Y

The value returned when its corresponding input is equal to the value in a specified field

input2

N

A secondary input to be compared against the value in a specified field

value2

N

The value returned when its corresponding input is equal to the value in a specified field

default_value

N

The value returned in the case that no inputs correspond to the value of the specified field.

Examples

Example 1:

=switch($"weekday_number",1,"Sunday",2,"Monday",3,"Tuesday","No match")

Example 2:

=switch($"Rank",5,"Five Star",4,"Four Star",3,"Needs Work",2,"Needs Work",1,"Needs Work","n/a")

NotEquals !=

Formula

=notequals(<input 1>, [input 2], ...)

=<input1>!=[input2]

Description

Returns False if every input is equal to each other, otherwise returns True

Arguments

Argument

Required (Y/N)

Description

Input 1

Y

Value evaluated along with other input values (Input 2...Input N)

Examples

Example 1:

=notequals(5, 5) will return False

=5!=5 will return False

Example 2:

=notequals(5,5,3) will return True

=5!=5!=3 will return True

Example 3:

=equals($"FirstName", "Smith")

=$"FirstName"!="Smith"

Or ||

Formula

=or(<input 1>, [input 2], ...)

=<input1>||[input2]

Description

Returns True if at least one input is True, otherwise returns False

Arguments

Argument

Required (Y/N)

Description

Input 1

Y

The first value or condition that you want to evaluate for TRUE or FALSE

Input 2

N

The second value or condition that you want to evaluate for TRUE or FALSE

... Input N

N

The nth value or condition that you want to evaluate for TRUE or FALSE

Examples

Example 1:

=or(equals(2,5), equals(4,4)) = True

=(2=5)||(4=4)

Example 2:

=or(not($"Is Employee"), $"Lives in North America")

=($"Is Employee"=FALSE)||($"Lives in North America"="TRUE")

Xor ^

Formula

=xor(<input 1>, [input 2], ...)

=<input1>^<input2>

Description

Returns True if at exactly one input is true, otherwise returns False

Arguments

Argument

Required (Y/N)

Description

Input 1

Y

The first value or condition that you want to evaluate for TRUE or FALSE

Input 2

N

The second value or condition that you want to evaluate for TRUE or FALSE

... Input N

N

The nth value or condition that you want to evaluate for TRUE or FALSE

Examples

Example 1:

=xor(equals(2,5), equals(4,4)) will return False

=(2=5)^(4=4) will return True

Example 2:

=xor(equals(2, 5), equals(4,5)) will return False

=(2=5)^(4=5) will return False

Example 3:

=xor(not($"Is Employee"), $"Lives in North America")

=($"Is Employee"="FALSE")^($"Lives in North America"="FALSE")

Not

Formula

=not(<input>)

Description

Returns True if the given input is False, otherwise returns False.

Arguments

Argument

Required (Y/N)

Description

Input

Y

Statement or operation that is evaluated for True condition

Examples

Example 1:

=not(true) = False

Example 2:

=not($"Is Employee")

Contains

Formula

=contains(<input>, <content>)

Description

Returns True if the given content is contained within the input argument, otherwise returns False.

Arguments

Argument

Required (Y/N)

Description

Input

Y

Statement or operation that is searched for the presence of Content value

Content

Y

Value to be searched within Input argument

Examples

Example 1:

=contains("last name", "name") will return True

Example 2:

=contains($"date", "2020-02-2017")

Example 3:

=contains($"full name", $"last name")

Iferror

Formula

=iferror(<condition>, <value_if_error>, [value_if_no_error])

Description

Returns value_if_error if the condition has an Error. Otherwise returns value_if_no_error.

Arguments

Argument

Required (Y/N)

Description

Condition

Y

Statement, value or logical operation evaluated for ERROR

value_if_error

Y

Value returned if Condition has an ERROR

value_if_no_error

N

Value returned if Condition does not have an ERROR

Examples

Example 1:

=iferror($"request_date", "Date Missing",$"request_date")

Example 2:

=iferror(divide(10,0), "Divide by zero") will return "Divide by zero"

Less Than >

Formula

=<input1> > <input2>

Description

Returns a boolean True value if input1 is greater than to input2, otherwise returns False. Numeric values will be evaluated numerically, string values will be evaluated by lexicographical value.

Arguments

Argument

Required (Y/N)

Description

Input1

Y

Primary value for evaluation

Input2

Y

The second value that you want to be evaluated

Examples

Example 1:

=5>10 will return False

Example 2:

="cat">"bat" will return True, as "c" comes after "b" and so has a higher lexicographical value

Less Than or Equal To >=

Formula

=<input1> >= <input2>

Description

Returns a boolean True value if input1 is greater than or equal to to input2, otherwise returns False. Numeric values will be evaluated numerically, string values will be evaluated by lexicographical value.

Arguments

Argument

Required (Y/N)

Description

Input1

Y

Primary value for evaluation

Input2

Y

The second value that you want to be evaluated

Examples

Example 1:

=5>=10 will return False

Example 2:

="cat">="bat" will return True, as "c" comes after "b" and so has a higher lexicographical value

Example 3:

=if($"Q2Sales">=$"Q1_Sales", "Growth","Stagnation")

Greater Than <

Formula

=<input1> < <input2>

Description

Returns a boolean True value if input1 is less than than to input2, otherwise returns False. Numeric values will be evaluated numerically, string values will be evaluated by lexicographical value.

Arguments

Argument

Required (Y/N)

Description

Input1

Y

Primary value for evaluation

Input2

Y

The second value that you want to be evaluated

Examples

Example 1:

=10>5 will return False

Example 2:

="bat"<"cat" will return True, as "b" comes before "c" and so has a lesser lexicographical value

Greater Than or Equal To <=

Formula

=<input1> <= <input2>

Description

Returns a boolean True value if input1 is less than than or equal to input2, otherwise returns False. Numeric values will be evaluated numerically, string values will be evaluated by lexicographical value.

Arguments

Argument

Required (Y/N)

Description

Input1

Y

Primary value for evaluation

Input2

Y

The second value that you want to be evaluated

Examples

Example 1:

=10>=5 will return False

Example 2:

="bat"<="cat" will return True, as "b" comes before "c" and so has a lesser lexicographical value

Example 3:

=if($"Q2Sales"<=$"Q3_Sales","Stagnation", "Growth")

⏩
True & False Casting