How are Comparison Operators Used?
The availability of comparison operators for a report depends on:
(a)the type of database query that’s used to gather data for the report – this determines whether any comparison operators are allowed at all; and
The parameter-entry grid for a report that does NOT allow comparison operators has just two columns: a “Parameter Name”, which tells you what’s being requested, and a “Parameter Value” where you enter or select your value(s).
The parameter grid for a report that DOES allow operators has an extra column in the middle, which you use to choose the operator you want. The middle column doesn’t have a title, but it displays a symbol telling you the operator in effect.
If you aren’t sure what an operator means, you can hover over it to display a tooltip, as shown here.
To change the operator, click on the operator symbol in the grid and a pick-list of available operators appears.
In the above example, the report will include only a store that “Is any of” the stores in the parameter value list. (In practice, a multi-select Lookup is often used as an aid to choosing items for “Is any of” and “Is none of” operators.)
Case Sensitivity: whether your comparisons are case-sensitive depends on your production database(s).
If you don’t know what to expect, you can ask your IT department, or you can experiment with Mercury, running the same report multiple times but with different parameter values.
For example, say your report has a Size parameter. You could run the report three different times, varying the Size parameter value: “medium”, “Medium”, and “MEDIUM”. If the results are different, it’s a clue that your IT department has made your production database case-sensitive.
Many databases make a distinction between a “Null” value and a “blank” value.
Null means no value was provided at all. It’s not available or wasn’t specified when the data were entered into the database.
Blank is an actual value – it was specified, and it just happens to be blank or empty.
Your company’s database may or may not support Null values. Even if it does, as a matter of internal policy your company may have chosen to disallow null values when saving data. You may need to ask your IT department or do a little experimenting to find out how operators relating to Null or Blank values affect your report results.
Symbol | Meaning | Selects records where the data field’s value … |
| Equals | is equal to the parameter value |
| Does-Not-Equal | is not equal to the parameter value |
| Greater | is greater than your parameter value |
| Greater-Or-Equal | is greater than or equal to your parameter value |
| Less | is less than your parameter value |
| Less-Or-Equal | is less than or equal to your parameter value |
| Between | is between two parameter values that you provide. The values are separated by two consecutive periods.
For example,
For Between (and Not-Between), you can also pop open a box that lets you enter the from and to values separately, which is sometimes easier than working with the two-dot separator.
|
| Not-Between | is NOT between two parameter values that you provide. As in “Between”, separate the values with two dots (periods). |
| AnyOf | is any of a specific list of desired values. “AnyOf” and “NoneOf” are typically used in conjunction with a multi-select Lookup list. |
| NoneOf | is NOT any of a specific list of values (in other words, the parameter value(s) specify items to be excluded from the report, instead of included) |
| IsNull | is Null: unspecified / undefined / unavailable (see the blue tip box above) |
| IsNotNull | is specified (any existing value is OK, including blanks) |
| IsNotBlank | is specified and also NOT empty – no blanks |
| Like | contains the specified parameter value.
You can include the wild-card “%” to match more than one part of the data field.
If your parameter was associated with a “LastName” field in your data, then:
|
| BeginsWith | begins with the parameter value |
| EndsWith | ends with the parameter value |
Here’s a parameter entry grid specifying three customers, luxury products only, for orders placed from Oct 1 2020 through Dec 31 2021.
Parameter Name |
| Parameter Value |
Customer List |
| ApexTreks; Cycle Crazy; Pedal Pushers |
Product Description |
| Luxury |
Order Date |
| 10/01/2021..12/31/2021 |