Open topic with navigation
Creating report view filter queries
Filter queries define what is visible in a report view. The filter query builder is where you define the filter. The filter query builder is on a view's Filter tab.
You can use the following options:
- Select attribute to filter by: Lists attributes for the item you selected when you created the filter. You cannot filter on values from a multi-contact control or table control.
- Scope: Lists relational operators. These operators determine which description values for a certain component will satisfy the query.
- Display current values: Lists existing values for the chosen inventory attribute. You can also manually enter an appropriate value, or edit a selected value, with the Edit values box. If the selected relational operator is Exists or Not Exists, no description values are possible.
- Logical operator: (displayed in a drop-down list) Determines how query statements logically relate to each other:
- AND: Both the previous query statement AND the statement to be inserted must be true to satisfy the query.
- OR: Either the previous query statement OR the statement to be inserted must be true to satisfy the query.
- Insert: Inserts the new statement into the query list and logically relates it to the other statements according to the listed logical operator. You can't choose this button until you've built an acceptable query statement.
- Edit: Lets you edit the selected query statement. When you're finished making changes, click the Update button (which toggles between Update and Insert).
- Delete: Deletes the selected statement from the query list.
- Clear all: Deletes all statements from the query list.
- Query list: Lists each statement inserted into the query and its logical relationship to the other listed statements. Grouped statements are surrounded by parentheses.
- Group (): Groups the selected statements together so they're evaluated against each other before being evaluated against other statements.
- Ungroup: Ungroups the selected grouped statements.
Querying on user-defined values
A powerful way to create report view filter queries is to allow users to enter a user-defined value for the report query. When you choose an attribute and operand, one of the available options in the right pane is Insert a user-defined value.
When you click this option, you can choose to either run the query based on the name of the user running the report or you can prompt the user for a value. When prompting for a value, you can also provide a prompt string that users will see when they run the report that requests the value.
Once a user enters a value, the query runs using that value.
About the "Like" operator
Note that if a user doesn't specify any wild cards (*) in a query, the Like operator adds wildcards (%) to both ends of the string. Here are three examples of using the Like operator:
Computer.Display Name LIKE "Bob's Machine" queries for: Computer.Display Name LIKE "%Bob's Machine%"
Computer.Display Name LIKE "Bob's Machine*" queries for: Computer.Display Name LIKE "Bob's Machine%"
Computer.Display Name LIKE "*Bob's Machine" queries for: Computer.Display Name LIKE "%Bob's Machine"