MicroStrategy ONE
Comparison Operators
Comparison operators compare values. The values can be numbers, text strings, or expressions. The comparison operators are as follows:
- Between: Identifies values in a range that includes both a lower and an upper limit. For example, "between 10 and 20" returns all values that are greater than or equal to 10 and less than or equal to 20.
- Different from: Identifies values that are other than the specific value indicated. For example, "different from 10" returns all values that are not 10.
- Exactly: Identifies an specific value. For example, "exactly 1" returns all items with a value of 1.
- Greater than: Identifies values that are greater than an indicated lower limit. For example, "greater than 10" returns values that are greater than 10.
- Greater than or equal to: Identifies values that are greater than or equal to the limit indicated. For example, "greater than or equal to 10" returns all values that are 10 or greater.
- Less than: Identifies values that are less than an indicated upper limit. For example, "less than 10" returns values that are less that 10.
- Less than or equal to: Identifies values that are less than or equal to the limit indicated. For example, "less than or equal to 10" returns all values that are 10 or less.
- Not between: Identifies values that are outside a specified range. For example, "not between 10 and 20" returns all values that are less than 10 and greater than 20.
- Is null: Identifies values that are null.
- Is Not null: Identifies values that are not null.
When you use these operators on a description for a date, the results can appear to be incorrect. For example, assume the date description is formatted as Jan 2023. Create a filter on the description attribute using the Between operator to return the months between January 2023 and June 2023. The results are Jan 2023, Jul 2023, and Jul 2023, not the first six months of the year as expected. This occurs because the description attribute is formatted as text, not as numbers or dates, and therefore the SQL sorts the data alphabetically. To obtain results of January 2023, February 2023, March 2023, April 2023, May 2023, and June 2023, filter on the ID rather than the description or use the in list operator.