PREVIOUS   NEXT Menu Index



Applying Conditions or Filters to an Object


You can apply two different types of conditions or filters to a query object:

 

Applying pre-defined conditions

Pre-defined conditions provide an easy way to distribute customized capabilities that might be necessary for your data needs, without forcing users to learn how to create conditions on their own or to enter complex data sets. This type of condition is defined by the BusinessObjects designer who created the universe.

  • For example, your universe lets users make inquiries about revenues for a chain of holiday resorts. Sales figures can be grouped by year. To make it easier to restrict revenue information to specific years, you might use a predefined condition that filters out all but a particular set of annual results.

You can find pre-defined condition objects by clicking the Conditions tab and looking in the Classes and Objects panel.

*

* Note that condition objects use the same icon as the Condition button in the Results tab toolbar.

  To add a pre-defined condition to your document:

  1. If necessary, click Edit to return to the Web Panel.
  2. Click the Conditions tab to open the Conditions panel.
  3. Drag the condition you want to use from the Classes and Objects panel into the Query Conditions panel, or simply double-click the condition.

    The condition takes effect the next time you run the query.

The effect of the condition depends on the functionality built into the object. These should be documented by the object designers in your organization.

 

Applying user-defined conditions and filters

User-defined conditions and filters let you set up your own custom conditions to use in your document. They perform the same function as predefined conditions, but they also let you personalize the final document results.

For example, you may want to generate a document containing information about customers from a specific country, instead of all the customers in the database.

You create user-defined conditions on the Conditions tab in the Web Panel. Each condition is named after the object to which you're applying the condition. There are two other possible parts to the condition:

  • An operator, which specifies how WebIntelligence should test the data.
  • An operand, which specifies what value(s) the data should be tested against.

The following table contains the available condition operators and specifies the type of operand each operator requires:
Condition
Operator
Operand
Equal To Are equal to A single alphanumeric or string value
Different From Are different from A single alphanumeric or string value
Greater Than Are greater than A single alphanumeric or string value
Greater Than Or Equal To Are greater than or equal to A single alphanumeric or string value
Less Than Are less than A single alphanumeric or string value
Less Than Or Equal To Are less than or equal to A single alphanumeric or string value
Between Are between Two alphanumeric or string values; this includes the parameters--that is, WebIntelligence considers the parameters themselves to be between the two parameters
Not Between Are not between Two alphanumeric or string values; this excludes the parameters--that is, WebIntelligence considers the parameters themselves to be between the two parameters and doesn't return values containing the parameters if present
In List Are in a list consisting of One or more alphanumeric or string values
Not In List Are not in a list consisting of Two or more alphanumeric or string values
Is Null Are null No parameters
Is Not Null Are not null No parameters
Matches Pattern Contain a pattern specified by A single alphanumeric or string value
Does Not Match Do not contain a pattern specified by A single alphanumeric or string value
Both Are both Two alphanumeric or string values
Except Are any value but A single alphanumeric or string value

To add a user-defined condition to an object:

  1. You can apply a condition to an object by doing either of the following:
    • Drag the object from the Classes and Objects panel into the Block panel. With the object still selected, click the Condition button in the toolbar. The Web Panel takes you to the Conditions tab automatically.
    • Go to the Conditions tab of the Web Panel. Drag the object to which you want to apply the condition into the Conditions tab.

Note: When at least one condition has been added to the Conditions tab, the Condition icon appears in the actual Condition tab, as well as the object.


    • Select the condition's operator from the list in the middle of the object.

      *

  1. Specify any required operands by clicking on the far right side of the condition and keeping the mouse button pressed until another list drops down.

    *

  2. Select one of the following from the list:
Enter a constant

    Displays an entry box in which you can type the operand value you want to be used in the condition.


Note: If no data in the database corresponds to this value, you receive the message "No data to fetch." When you click OK, the operand entry box reappears. Enter a valid value then click OK.


  • Show list of values
    Queries the database and returns a list of values from which you can select one or more values. The number of values you can select depends on the operator you defined for the condition.
    For example, if the "Equal to" operator is specified, only one operand value can be selected.
  • Prompt list of values
    Lets you create a user prompt for the selection of an operand from a list of pre-defined values.
    When you select this option, an entry box appears containing the data object's name. This will be the operand prompt's label. The default label is the recommended setting.
    When you run the query, or whenever a user tries to refresh the document, a dialog box will appear prompting the selection of a value from a pre-defined list for this condition.

*
An operand must be selected from the list before the query can be run or the document refreshed.

  • Enter a prompt.
    Lets you create a user prompt for the definition of a new operand value.
    When you click this option, an entry box appears containing the data object's name. This will be the operand prompt's label. The default label is the recommended setting.
    When you run the query, or whenever a user tries to refresh the document, a dialog box appears prompting the entry of an operand value.

*
A value must be entered before the query can be run or the document refreshed.


Note: If no data in the database corresponds to this operand, you receive the message "No data to fetch." When you click OK, the operand entry box reappears. Enter a valid operand then click OK.


Once you've added all your data objects and conditions, you can run the query by clicking the Run Query button. This returns the generated document containing query results.

For information on formatting your document, see Formatting Documents.

Deleting a Condition

There are several ways to delete an applied condition from either the Section / Detail panels in the Results tab, or the Conditions panel from the Conditions tab:

  • If you're using the Full Java applet version of the Web Panel or the ActiveX Web Panel, you can delete the conditions object in two ways: You can either select the condition object then press the Del key on your keyboard, or drag the condition object back to the Classes and Objects panel.
  • If you're using the Light Java applet version of the Web Panel, you can drag the condition object back to the Classes and Objects panel.

Combining Conditions

You can combine conditions to increase your control over the data a document contains. Combining conditions lets you retrieve data that, for example, contains the strings Smith or Johnson, or concerns customers from the United States with an income between $50,000 and $100,000.

Whenever you have more than one condition in a document, WebIntelligence automatically combines them with an "And". All you actually have to do to combine conditions is add them to your query.

*

Once combined, however, you can determine how the conditions work together by bracketing them together and changing the logical operators that specify how the conditions are combined.

Logical Operators

Logical operators let you specify how you want conditions combined. This allows you to create a set of conditions, for example, that returns all items whose total sales were greater than $10,000 and were sold to customers in France.

WebIntelligence conditions allow only two types of logical operators:

  • The And logical operator combines two conditions into a narrower condition. A data item must meet the first condition and the second condition to meet the condition's requirements.
  • The Or logical operator combines two conditions into a broader condition. A data item can meet the first condition or the second condition to meet the condition's requirements.

To switch between the And operator and the Or operator, double-click the operator object on the Conditions tab.


Note: When you change an operator, all the operators in the same indentation level change as well. For information about indenting conditions, see the following section.


Bracketing conditions

If you've combined at least three conditions in your query, you can bracket certain conditions to bind them together. You use this the same way you might use parentheses to change the value a in the following arithmetic equations:

a= 36 * (6 +12) as opposed to a = (36 * 6) + 12

For example, you want information about the service preferences of American clients at the Bahamas Beach and the Hawaiian Club resorts in 1995.

Your query looks like this:

This image shows Country in the section panel, and in the crosstab panel Resort and Service on the left side, Year as the column header, and Number of guests as the measure in the table.

You have dropped the following conditions in the Conditions tab:

This image shows Hawaiian Resort AND Bahamas Resort AND Year 1995 AND US customer as conditions dropped in the Conditions tab.

You want data for either the Hawaiian resort or the Bahamas resorts, from 1995 for American customers. To obtain that data, you now need to define the required operators and indent certain conditions to order the conditions hierarchically:

(Hawaiian OR Bahamas) AND 1995 AND American customers:

This image shows Hawaiian resort OR Bahamas resort AND Year 1995 AND US customer.

You can use as many brackets on the Conditions tab as your conditions allow.
To bracket query conditions:

  1. In the Web Panel's Condition tab, make sure at least three conditions have been added.
*
  1. Click the And or Or operator joining the two conditions you want to bracket, then click the Shift Right button in the toolbar. WebIntelligence indents the conditions to the right and puts an open bracket around them.
*
  1. To undo a bracket, simply click the Shift Left button in the toolbar.

Return to topic: Defining Conditions and Filters

Return to topic: Working with Document Data


PREVIOUS   NEXT
www.businessobjects.com
documentation@businessobjects.com


Copyright © 1990-2003 Business Objects S.A. All rights reserved.