Topics Map > University of Chicago > IT Services > Business Systems > Reporting Systems
Business Objects - WebI - Using Wildcards for Pattern Matching in Query Conditions
This article explains how to use single and multiple character wildcards for pattern matching in query conditions.
This article explains how to use single and multiple character wildcards for pattern-matching in query conditions.
Wildcards are special characters that denote any single character or any number of characters. When entering a pattern-match for a prompt (or a constant in the query), use the following wildcards:
- _ (underscore) for any single character
- % (percent sign) for any number of characters
Understanding the Single-character Wildcard
To look for the product categories of either SHIRTS or SKIRTS, use the pattern S_IRTS. This pattern specifies that the values retrieved must:
- Be six characters long
- Have S as the first character and IRTS as the final four
The _ means there can be a single unspecified character between the S and the IRTS.
Understanding the Multiple-character Wildcard
To look for any product category beginning with the letter B, use the pattern B%. This pattern specifies that the values retrieved must have B as the first character. The % means that the B can be followed by an unspecified number of characters.
Entering Wildcards for a Pattern-matching (contains) Prompt:
A report that uses a predefined pattern-matching condition will prompt you for either "...starting with" or "... contains". You can use wildcards in the text you enter for these prompts, but remember that the "...starting with" prompt will have a multi-character wildcard appended to the end and the "...contains" prompt will have the multi-character wildcard appended to both the start and end.
Creating a Query Filter With a Wildcard
You can use wildcards as placeholders for partial pattern searches. When you create the query filter using a wildcard, you must use one of the following relational operators.
- Matches pattern: to find values that match the pattern you specify
- Different from pattern: to find values different than the pattern you specify
Apply Wildcards to Query Filters
In the Query panel, drag the object you want to filter by into the Query Filters pane.
Click the Operator Type drop-down arrow, and select Matches pattern from the list.
Click the filter definition text box and type the wildcard pattern you want to use.
When you have entered all of the query filters and result objects you need, click Run Query.
If you want to use multiple matches:
Create the first query filter using the steps above.
Click Add nested filter (at the far right on the query filters). This adds an OR nest in the query panel.
- Move the existing matching filter to the nest and then create a second matching filter in the nest (or move it to the nest)
The report results should reflect the wildcard you entered.