| Oracle Discoverer Administration Edition Administration Guide Release 4.1 for Windows A86730-01 |
|
This chapter consists of the following sections:
A condition can be used to selectively filter out data. If you took the tutorial in Chapter 4, you will have created a condition that analyzed the chain of video stores and selected only those departments equal to Video Sales or Video Rentals.
End users can use Conditions to restrict the results of their query to the areas they are interested in. This can result in faster queries.
There are two types of Condition:
For example, you may want to assign a mandatory Condition to sales data for regional sales managers, limiting their view of sales to the region for which each manager is responsible.
For example, a Vice President responsible for all sales regions should be able to see all of the sales data, and also be able to apply Conditions to see sales data pertaining to specific sales regions.
You create mandatory and optional conditions in the same way, and although Discoverer Administration Edition enables you to change a condition from optional to mandatory and vice versa, there are some subtle differences between the two types of condition. These differences are shown in Table 13-1.
This section describes how to create a new Condition.
There are three ways of doing this:
The New Condition dialog box (see Figure 13-2) enables you to create a new Condition and add it to the selected Folder.
|
NOTE: If you didn't select a Folder or Item in step 1, Discoverer Administration Edition displays the New Condition dialog box (see Figure 13-1). Select the Folder or Item for your new Condition using this dialog box (you can select any Folder or Item from within any open Business Area). |
See Section 13.1.2, "Condition Types" for more information.
This section describes how to finish creating a Condition based on a single Item. For example, "Region = East".
The Item drop-down list also enables you to create a Condition based on:
For more information on creating Calculations, see Chapter 12.2, "Creating Calculations".
You can also type the values directly into the field:
The Value(s) drop-down list also enables you to create a calculated value to use with this condition (choose Create Calculation...).
For more information about the fields on this dialog box, click Help.
This section describes how to finish creating a Condition based on multiple Items. For example, "(Department IN 'Video Sale' or 'Video Rental') AND (Region = Central)".
This displays the advanced version of the Edit Condition dialog box (see Figure 13-3).
Note that the SQL code for the formula is displayed at the bottom of the dialog box.
This adds a new row to the Condition.
The Item drop-down list also enables you to create a Condition based on:
For more information on creating Calculations, see Chapter 12.2, "Creating Calculations".Select the type of comparison (using the Condition drop-down list).
You can also type the values directly into the field:
The Value(s) drop-down list also enables you to create a calculated value to use with this condition (choose Create Calculation...).
For more information about the fields on this dialog box, click Help.
Condition properties are accessible through Condition Properties dialog boxes. This section shows you how to enhance the user's view of the data by editing Condition properties. Figure 13-4 shows an example Condition Properties dialog box.
This section describes how to edit a Condition's properties.
There are four ways to do this:
For more information on the fields on this dialog box, click Help.
The following steps show you how to set common properties for more than one Condition at a time:
There are three ways to do this:
All properties that are common to each of the selected Conditions are displayed. If the data for a field is not common to each of the selected Conditions, the field is blank.
For more information on the fields on this dialog box, click Help.
This section describes how to edit an existing Condition.
There are three ways to do this:
The Edit Condition dialog box works in the same way as the New Condition dialog box (see Section 13.2, "Creating Conditions" for more information).
This section describes how to delete Conditions.
To select more than one Condition at once, hold down Ctrl while you click on the Conditions.
There are three ways to do this:
This opens the Confirm Delete dialog box.
This example describes how to create a Condition that only returns the Sales in the Last Seven Days. It uses the Calculation Item, "Transaction Age (in Days)".
This is sometimes described as a "rolling window" Condition because the "window" of rows it returns changes from day to day.
This example describes how to create a Condition that only returns Shipments made in Q3 (regardless of year). It uses the Calculation Item, "Ship Quarter".
This Condition will now only return Shipments that were made in Q3 (regardless of year).
This example shows how the registry setting DisableAutoOuterJoinsOnFilters can affect the result set when a condition (filter) is applied in Discoverer (see Chapter E.2, "Registry Settings"). The effect that this registry setting has is best understood by using an example.
The table below summarizes the conditions used in the examples that follow:
|
Registry Value |
Condition Applied? |
|
1 or 0 |
No (See example 1) |
|
1 |
Yes (See example 2) |
|
0 |
Yes (See example 3) |
select dname, ename, job from dept, emp where dept.deptno = emp.deptno (+);
|
DNAME |
ENAME |
JOB |
|
SALES |
GRIMES |
DIRECTOR |
|
SALES |
PETERS |
MANAGER |
|
SALES |
SCOTT |
CLERK |
|
SUPPORT |
MAJOR |
MANAGER |
|
SUPPORT |
SCOTT |
CLERK |
|
ADMIN |
|
|
|
MARKETING |
|
|
|
DISTRIBUTION |
|
|
select dname, ename, job from dept, emp where dept.depno = emp.deptno (+) and job (+) = 'CLERK';.
|
DNAME |
ENAME |
JOB |
|
SALES |
SCOTT |
CLERK |
|
SUPPORT |
SCOTT |
CLERK |
|
ADMIN |
|
|
|
MARKETING |
|
|
|
DISTRIBUTION |
|
|
Note: Outer joins will not be placed on 'IN', 'IS NULL' or 'IS NOT NULL' clauses as this is not a supported operation by the database.
select dname, ename, job from dept, emp where dept.deptno = emp.deptno(+) and job = 'CLERK';
|
DNAME |
ENAME |
JOB |
|
SALES |
SCOTT |
CLERK |
|
SUPPORT |
SCOTT |
CLERK |
|
|
![]() Copyright © 2000 Oracle Corporation. All Rights Reserved. |
|