Comparison Operators
Use comparison operators to compare values of the same type. For example, you can
compare strings with strings and numbers with numbers.
| Operator | Name | Description |
|---|---|---|
| == | Equals | Returns True if the operands are equal. String comparisons that use the equals operator are case-sensitive. |
| != | Not equals | Returns True if the operands aren't equal. |
| < | Less than | Returns True if the left operand is less than the right operand. |
| <= | Less or equal | Returns True if the left operand is less than or equal to the right operand. |
| > | Greater than | Returns True if the left operand is greater than the right operand. |
| >= | Greater or equal | Returns True if the left operand is greater than or equal to the right operand. |
| like | Like | Returns True if the left operand contains the string on the right. Wildcards and regular expressions aren't supported. This operator is case-sensitive. To match any single character in the string, include an underscore (_). To match any pattern of zero or more characters include a percent sign (%). Starting a pattern with a percent sign returns all words that are either the pattern itself or that end with it. Ending a pattern with a percent sign returns all the words that are either the pattern itself or that begin with it. To match a pattern anywhere in a string, the pattern must start and end with a percent sign. To include a literal percent sign or underscore in a pattern, you must escape them with a backwards slash (\). Use with ! to exclude records. |
| matches | Matches | Returns True if the left operand contains the string on the right. Wildcards and regular expressions aren't supported. This operator isn't case-sensitive. Single-character matches aren't supported. |
| in | In | Returns True if the left operand contains one or more of the values in the array on the right. If the left operand is a measure, the query returns True if the left operand is in the array on the right. Use the date() function to filter by date ranges. If you search for values in an empty array, in returns False. Ranges that are out of order evaluate to False. For example, ["Z" .. "A"] evaluates to False. |
| not in | Not in | Returns True if the left operand isn't equal to any of the values in an array on the right. |
Note: For multivalue fields, use in to identify rows that contain some value.
Note: For multivalue fields, use not in to identify rows that don't contain some value.
This query matches names such as Anita Boyle, Annie Booth, Derek Jernigan, and Hazel Jennings:
1q = filter q by Customer_Name like "%ni%";This query matches names that end with "ne" or contain "ne." These names include Andrew Levine, Annette Boone, Annette Cline, and Annie Horne:
1q = filter q by Customer_Name like "%ne";This query shows all customer names that don't contain "po":
1q = filter q by !(Customer_Name like "%po%");This query matches airport codes such as LAX, LAS, ALA, and BLA:
1my_matches = filter a by origin matches "LA";Use ! to exclude records. This query shows all opportunities where Stage isn't equal to Closed Lost or Closed Won:
1q = filter q by !('Stage' matches "Closed");For example:
1a1 = filter a by origin in ["ORD", "LAX", "LGA"];