Oracle Discoverer Administration Edition Administration Guide
Release 4.1 for Windows

A86730-01

Library

Contents

Index

Prev Next

13
Conditions

This chapter consists of the following sections:

13.1 Introduction

13.1.1 What is a Condition?

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.

13.1.2 Condition Types

There are two types of Condition:

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.

Table 13-1 Difference Between Mandatory and Optional Conditions
Mandatory Conditions  Optional Conditions 

Are always applied to the results of a folder. 

Are only applied to the results of a folder if selected in Discoverer Plus. 

Are used by an administrator to permanently restrict the rows returned by a folder. 

Are provided by an administrator as a shortcut to help users build conditions more easily. 

Are invisible in Discoverer Plus. 

Are visible (but not editable) in Discoverer Plus. 

When created in a complex folder, can reference items in the source folders. 

When created in a complex folder, can only reference items in the complex folder. 

Affect the result set of the folder definition in the EUL. 

Do not affect the result set of the folder definition in the EUL (because they are only applied when used in Discoverer Plus). 

When added, changed, or deleted, cause any summaries based on the folder to become invalid, because their result set no longer matches that of the folder.

These summaries are set to "Refresh required" and must be refreshed to be made available again. 

When added, changed, or deleted have no affect on summaries based on the folder.

 

13.2 Creating Conditions

This section describes how to create a new Condition.

  1. On the Data page of the work area, either

    • select the Folder that you want to contain your new Condition, or

    • select the Item that you want to form part of your Condition.

  2. Open the New Condition dialog box.

    There are three ways of doing this:

    • Popup Menu
      Right-click the Folder or Item on the Data page and choose New Condition... on the popup menu.

    • Toolbar Icon
      Click the New condition toolbar icon ()

    • Menu
      Choose Insert | Condition....

    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). 


Figure 13-1 Selecting a Folder or Item for your new Condition


Figure 13-2 New Condition Dialog Box



NOTE: By default, Discoverer Administration Edition chooses a name for your new Condition based on the Condition itself. If you want to specify a name other than the default, clear Generate name automatically and enter the Name


  • Specify the Description for your new Condition.

  • Set Type to either Required or Optional.


    NOTE: When you create a Condition based on an Analytic Function, you must designate the Condition as `optional'. If you choose `mandatory, a message is displayed informing you that Analytic Functions are not allowed in mandatory conditions. 


    13.2.1 Single Item Conditions

    This section describes how to finish creating a Condition based on a single Item. For example, "Region = East".

    1. Select the Item that you want to base your Condition on (using the Item drop-down list).

      The Item drop-down list also enables you to create a Condition based on:

      • a Calculation (choose Create Calculation...), or

      • an existing Condition (choose Select Condition...).

      For more information on creating Calculations, see Chapter 12.2, "Creating Calculations".

    2. Select the type of comparison (using the Condition drop-down list).

    3. Select the value(s) that are to be compared with the Item (using the Value(s) drop-down list).

      You can also type the values directly into the field:

      • Surround values consisting of alphabetical characters with single quotes (`entry')

      • Do not surround numeric values with quotes.

      • Separate multiple values with commas.

      The Value(s) drop-down list also enables you to create a calculated value to use with this condition (choose Create Calculation...).

    4. If you want the Condition to be case sensitive, tick Match Case, otherwise, clear it.

    5. Click OK.

    For more information about the fields on this dialog box, click Help.

    13.2.2 Multiple Item Conditions

    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)".

    1. Click Advanced >>.

      This displays the advanced version of the Edit Condition dialog box (see Figure 13-3).

    Figure 13-3 New Condition Dialog Box with Advanced Selected

    For more information on creating Calculations, see Chapter 12.2, "Creating Calculations".Select the type of comparison (using the Condition drop-down list).

    1. Select the value(s) that are to be compared with the Item (using the Value(s) drop-down list).

      You can also type the values directly into the field:

      • Surround values consisting of alphabetical characters with single quotes (`entry')

      • Do not surround numeric values with quotes.

      • Separate multiple values with commas.

      The Value(s) drop-down list also enables you to create a calculated value to use with this condition (choose Create Calculation...).

    2. Repeat steps 2 to 5 to add more rows to your Condition formula.


    NOTE: You can delete a row from the Condition formula by selecting it and clicking Delete


    1. Click in the Group column and choose how the rows in the Condition formula relate to each other:

      • If all of the rows must be true to display the data, click And.

      • If only one of the rows has to be true to display the data, click Or.

      • If all of the rows must be false to display the data, click Not.

    2. If you want the Condition to be case sensitive, tick Match Case, otherwise, clear it.

    3. Click OK.

    For more information about the fields on this dialog box, click Help.

    13.3 Editing Condition Properties

    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.

    Figure 13-4 Condition Properties Dialog Box with the General Tab Selected

    13.3.1 Editing the Properties of a Single Condition

    This section describes how to edit a Condition's properties.

    1. Open the Condition's Properties dialog box.

      There are four ways to do this:

      • Double-click
        Double-click the Condition on the Data page.

      • Popup Menu
        Right-click the Condition on the Data page and choose Properties on the popup menu.

      • Toolbar Icon
        Click the Condition on the Data page and click the Properties toolbar icon ()

      • Menu
        Click the Condition on the Data page and choose Edit | Properties.

    2. Make your changes as required.

      For more information on the fields on this dialog box, click Help.

    3. Click OK.

    13.3.2 Editing the Properties of Multiple Conditions

    The following steps show you how to set common properties for more than one Condition at a time:

    1. Select all of the Conditions whose properties you want to edit.
      (Ctrl-clicking enables you to select more than one Condition.)

    2. Display the Condition Properties dialog box.

      There are three ways to do this:

      • Popup Menu
        Right-click one of the selected Conditions on the Data page and choose Properties on the popup menu.

      • Toolbar Icon
        Click the Properties toolbar icon ()

      • Menu
        Choose Edit | Properties.

      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.

    3. Make your changes as required.
      Any changes you make here will be applied to all of the selected Conditions.

      For more information on the fields on this dialog box, click Help.

    4. Click OK.

    13.4 Editing Conditions

    This section describes how to edit an existing Condition.

    1. Display the Edit Condition dialog box (see Figure 13-2).

      There are three ways to do this:

      • Popup Menu
        Right-click the Condition on the Data page and choose Edit Condition... on the popup menu.

      • Menu
        Click the Condition on the Data page and choose Edit | Edit...

      • Condition Properties Dialog Box
        Click in the Formula field on the Condition Properties dialog box.

      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).

    2. Edit the Condition as required.

    3. Click OK.

    13.5 Deleting Conditions

    This section describes how to delete Conditions.

    1. Select the Condition(s) that you want to delete.

      To select more than one Condition at once, hold down Ctrl while you click on the Conditions.

    2. Delete the Condition(s):

      There are three ways to do this:

      • Popup Menu
        Right-click one of the selected Condition(s) and choose Delete Condition... on the popup menu.

      • Menu
        Choose Edit | Delete.

      • Keyboard
        Press Delete.

      This opens the Confirm Delete dialog box.

    3. Click Impact.
      This displays the Impact dialog box that shows any other objects that may be affected by the deletion (Figure 13-5). The Impact dialog box helps you to make the right choice.

    Figure 13-5 The Impact Dialog Box

    1. When you have finished reviewing the impact this action will have, click OK.

    2. If you still want to delete the selected Condition(s), click Yes.

    13.6 Example Conditions

    13.6.1 Sales in the Last Seven Days

    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)".

    1. Create a new Condition:

      • Name: Sales in the Last Seven Days

      • Item: Transaction Age (in Days)

      • Condition: <

      • Additional calculations required: Transaction Age = FLOOR (SYSDATE - Transaction Date)

      • Value(s): 7

    This is sometimes described as a "rolling window" Condition because the "window" of rows it returns changes from day to day.

    13.6.2 Shipments in Q3

    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".

    1. Create a new Condition:

      • Name: Shipments in Q3

      • Item: Ship Quarter

      • Condition: =

      • Additional calculations required: Ship Quarter = EUL_DATE_TRUNC(Ship Date, "Q")

      • Value: Q3

    This Condition will now only return Shipments that were made in Q3 (regardless of year).

    13.6.3 Outer Join with Conditions behavior

    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) 

    Yes (See example 2) 

    Yes (See example 3) 

    Example 1 - Shows the rows fetched from a query where an outer join exists between the dept and emp tables (no condition applied):

    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 

     

     

    Example 2 - User adds a condition to the query in Example 1 and the registry setting is set to 0 (default behavior):

    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.

    Example 3 - User adds a condition to the query in Example 1 and the registry setting set to 1:

    select dname, ename, job from dept, emp where dept.deptno = emp.deptno(+) and job = 'CLERK';

    DNAME 

    ENAME 

    JOB 

    SALES 

    SCOTT 

    CLERK 

    SUPPORT 

    SCOTT 

    CLERK 


  • Prev Next
    Oracle
    Copyright © 2000 Oracle Corporation.

    All Rights Reserved.

    Library

    Contents

    Index