SQL Operators for Insights

Use these arithmetic, currency, and logical operators in SQL expressions when you author calculated insights in Data 360.

Required Editions

Available in: All Editions supported by Data 360. See Data 360 edition availability.

Arithmetic Operators

Use these operators to perform arithmetic operations on numeric operands.

Operator Description Supported Data Types
* Multiply Number, Integer, Percent, Currency
+ Add Number, Integer, Percent, Currency
- Subtract Number, Integer, Percent, Currency
/ Divide Number, Integer, Percent, Currency

Currency Operator

Operator Description Supported Data Types
TRY_CONVERT_CURRENCY Converts aggregate currency values into a single currency value. Currency

Logical Operators

Use these logical operators to combine one or more true or false values. Each operator returns a true or false value.

Operation Operator Supported Data Types
Not equal to != , <> Text, URL, Email, Phone, Number, Percent, Date, DateTime
Less than < Number, Percent, Date, DateTime
Less than or equal to <= Number, Percent, Date, DateTime
Equal to = Text, URL, Email, Phone, Number, Percent, Date, DateTime
Greater than > Number, Percent, Date, DateTime
Greater than or equal to >= Number, Percent, Date, DateTime
And and Text, URL, Email, Phone, Number, Percent, Date, DateTime, Boolean
Pattern match LIKE; % Text, URL, Email, Phone
Regular expression match RLIKE Text, URL, Email, Phone
Boolean evaluation Is_True, Is_False, Has_Boolean_Value, Has_No_Boolean_Value Boolean
Example
Example

This example uses logical operators to find individuals who spent more than $5, have a tax rate of 9 or less, an adjusted tax amount of 0, and have orders with a list price other than $100.

SELECT
SUM(SALESORDER__dlm.grand_total_amount__c) as TotalOrderAmount__c,
Individual__dlm.Id__c as CustomerId__c
FROM SALESORDER__dlm
LEFT JOIN Individual__dlm ON SALESORDER__dlm.partyid__c = Individual__dlm.Id__c
WHERE SALESORDER__dlm.grand_total_amount__c > 5
  and SALESORDER__dlm.tax_rate__c <= 9
  and SALESORDER__dlm.total_adjustment_tax_amount__c = 0
  and SALESORDER__dlm.list_price__c != 100
GROUP BY CustomerId__c