Discoverer 4i Plus Online Help
Release 4.1


Contents

Index

Finding Specific Data When a Workbook Opens

Databases often contain enormous amounts of information, and one key task necessary to work with a database efficiently is to find the specific information you want to see or analyze. Discoverer has a number of ways to filter out the data that you don't need to see and to find the specific data you want. Discoverer has filtering techniques both when you open a workbook initially and as you are working with the data.

The two basic ways to filter out unnecessary data and find the specific information you want when opening a workbook are to select Parameters and to apply Conditions.

Parameters actually use Condition statements to find specific data. However, unlike regular Conditions that find the same data each time they're applied, Parameters offer choices at the time the worksheet opens. For example, if the two Parameters for a worksheet are Department and City, the underlying Condition statement is "Find all the data about <Department> for a <City>". The two Parameters are essentially placeholders in the Condition statement until the person opening the worksheet picks a data value for each one. Then, Discoverer finds all the data based on the selected values. Click to learn more about Using Conditions.

Although similar, Parameters and Conditions are designed for different purposes. Parameters offer you a choice and help you open a workbook quickly to see just the data that you want to see. Conditions are specific, fixed statements. Conditions are designed more for analysis so you can apply Condition statements while you are involved with data analysis to find very specific sets of data. However, Conditions and Parameters can also be used with each other for more sophisticated filtering procedures.

Parameters

The main benefits of using Parameters are:

A Discoverer user often creates Parameters when creating the initial workbook. However, anyone with the proper access rights (granted by the Discoverer Administrator) can create Parameters too. When creating or choosing Parameters, the term data values refers to the choices offered by the Parameter. For example, if the Parameter is for choosing the cities for which you want to see data, the city names are the data values, that is, New York, Los Angeles, Denver are the data values for the Parameter to choose cities.

When opening a workbook you'll choose the data values for the Parameters. But if the Parameters do not offer the choices you want, you can create your own data values.

Choosing Data Values for Parameters When a Workbook Opens

When opening a worksheet with pre-defined Parameters, a dialog lists the Parameters so you can select the ones you want on the worksheet.

Note: Although choosing a data value for a Parameter limits the data initially displayed on the worksheet--for example, you limit the data to New York only--Parameters do not limit the data available for the worksheet as you are working with it. You can always add any additional data as you are working on the worksheet. Also, you can change Parameter values every time the query is refreshed, and you can edit Parameter values from the menu.

Depending on the design of the Parameters, you can choose:

  1. Open a worksheet. If Parameters are defined for the worksheet, a dialog lists the Parameters available for it. The default value is in the text box next to each Parameter.

  2. Choose a data value for the Parameter by doing one of the following:

    • To choose the default value, click OK

    • To choose a value other than the default value, click the down arrow next to the text field. From the drop-down list, choose the data value(s) you want. Then click OK.

    The worksheet appears and contains data only for the values you chose. In the example below, the Parameter value Central is selected. The resulting worksheet contains data only for the Central region.


  1. If the Parameter is set up to allow for multiple data values, you can select several data values when opening the worksheet. This type of Parameter selection offers complete flexibility to choose the exact combination of data to see. From the Edit Parameter Values dialog, click the drop down arrow and choose Select Multiple Values. The Values dialog appears.


  1. In the Select Values list, select the check box(es) next to the Items that you want to see in your Worksheet. To see all Items, click Select All.

  2. Click OK on the Values dialog and then click OK on the Parameters dialog. The worksheet is refreshed to display only data from the Items selected.


  1. If the workbook has multiple Parameters defined for it, click the drop down arrow next to each Parameter and select a data value for each one. The following example shows two Parameters--one for cities and the other for year--so you can select a combination of data to see.


Creating Parameters

Because Parameters use Condition statements to find specific data, creating a Parameter is similar to creating a simple Condition statement. You specify the data item to use for the Parameter, for example, the list of city names in your database, and then specify the choices available for that Parameter.

In addition to creating Parameters, you can edit them to change their default values, descriptions or headings. For example, if your company adds a new store to a sales region, you may want to edit the Parameter so that the new store is the default value for the Store.Name Parameter.

You can create Parameters at two levels:

    1. Workbook level - Here, the Parameter applies to all worksheets in your workbook. Changes to the Parameter in any worksheet cascade to all worksheets in the workbook.

    2. Worksheet level - Here, the Parameter applies to the current worksheet only.


To create a new Parameter:
  1. Display the worksheet to which you want to apply the Parameter.

  2. From the menu choose Tools | Parameters. The Edit Worksheet dialog opens with the Parameters tab highlighted.

  1. Click New. The New Parameter dialog appears.


  1. Type in or select the features of the Parameter.

    What do you want to name this Parameter--type the name that you want to appear in the Parameters dialog. If you don't type a name, Discoverer inserts a default Parameter name.

    Which item would you like to base you Parameter on--select the data item for the Parameter from the drop down list. For example, to create a Parameter for selecting a city, select the data item that contains the city names. The list shows the data items currently used in the worksheet. It also shows all items related to the items selected in the worksheet and all calculations.

    What prompt do you want to show to other users--this text appears in the dialog that appears prior to opening the worksheet; type text that prompts the user to make a selection.

    What description do you want to show to other users--this text also appears in the dialog; it explains the Parameter.

    What default value do you want to give this Parameter--this is the pre-selected data value for the Parameter. Click the drop down arrow and select a data value from the list, or type the default value directly into the box.

    Let other users select multiple values--select this option if you want the person using the worksheet to be able to select multiple data values for the Parameter when opening the worksheet. If this option is not selected, the person can choose only one value for the Parameter.

    What is the value of this parameter if it is used in more than one sheet?--allows you to create the Parameter either at Workbook level or Worksheet level.
    Click 'Allow only one value for all Sheets' to make the parameter value cascade across all worksheets in the workbook. Click 'Allow a different value in each Sheet' to make the parameter value apply to the current worksheet only.

    Parameterized Conditions refer to Condition statements that use a Parameter in their formulas. For example, if the Condition statement uses City in its formula, and you select New York as the data value for the Parameter, the Condition statement use New York as the City in the formula.

    Create Condition/use operator--creates a Condition with an operator. You can select the operator from the drop list. For example, select equals (=) to create a Condition with the formula "For Item" = "Parameter's Name." A typical use of this feature is to find data values greater then (>) or less than (<) a data value. For example, to find all the data after the year 1997 the Condition formula is "Year" > 1997. The worksheet then appears with data from 1998 on.

    Note: If you are creating a Parameter as part of a Condition, the portion of the dialog for creating Parameterized Conditions is not available because you are already defining a Condition.

  2. Click OK. The new Parameter now appears in the Parameters dialog.

    Moving the Parameters up and down in the Parameters dialog changes their position in the dialog that appears when opening a worksheet.

  3. Click OK in the Edit Worksheet Parameters tab.

    The Edit Parameter Values dialog appears, and you can specify the data value. The worksheet now displays the specific result for the data specified in the Edit Parameters dialog.

Parameters that are part of an active Condition are automatically activated as well. If you select the option Create Condition/use operator in the New Parameter dialog, a new Condition is created and activated, therefore the Parameter is also activated.

To deactivate a Parameter, deactivate the Condition. Deleting the Condition deletes the Parameter and vice versa.


To edit an existing Parameter:
  1. Display the worksheet to which you want to apply the Parameter.

  2. From the menu choose Tools | Parameters. The Edit Worksheet dialog opens with the Parameters tab highlighted.


  1. Click the name of the Parameter you want to edit and then click Edit. The Edit Parameter dialog appears.

Figure 2-1 Edit Parameter dialog

  1. Type in or select the features of the Parameter that you want to change.

    What do you want to name this Parameter--type the name that you want to appear in the Parameters dialog. If you don't type a name, Discoverer inserts a default Parameter name.

    What prompt do you want to show to other users--this text appears in the dialog that appears prior to opening the worksheet; type text that prompts the user to make a selection.

    What description do you want to show to other users--this text also appears in the dialog; it explains the Parameter.

    What default value do you want to give this Parameter--this is the pre-selected data value for the Parameter. Click the drop down arrow and select a data value from the list, or type the default value directly into the box.

    Let other users select multiple values--select this option if you want the person using the worksheet to be able to select multiple data values for the Parameter when opening the worksheet. If this option is not selected, the person can choose only one value for the Parameter.

  2. Click OK. You return to the Parameters tab.

  3. Click OK in the Parameters tab to apply your changes.


    To select different Parameter values:

  1. From the menu, choose Sheet | Edit Parameter Values. The Edit Parameters dialog appears.

Tip: You can click the Refresh icon to display the Edit Parameters dialog, (or choose Sheet | Refresh Sheet).


  1. Select a new data value, and click OK.

    You'll see the results corresponding to the data value you have chosen.

Conditions

A Condition is a statement for finding specific data. Turning on a Condition filters out the data that does not meet the Condition, and displays only the data that you want to see.

The following examples illustrate the concept of Conditions.

  • Click the drop down button for Operator and choose the Condition operator you want.


    1. To complete the definition of the Condition click in the Value(s) box and enter a data value.

      The drop-down list of values is a shortcut so you don't have to manually type the data value for an item. However, data values for various items might or might not appear in the list, depending on whether your Discoverer Administrator set up the workbook to show lists of values for different items. If clicking the Value(s) drop list button shows a list of data values you can then select the value you want for the item instead of manually typing it.

      For example, if the three values for the data item named Region are Central, East, and West, selecting "Region is equal to," and then clicking the drop list button displays Central, East, and West as the choices.

      The following example shows a Values drop-down list with choices for cities.


      To use the results of a calculation as the value, select Create Calculation. A dialog for creating a new calculation appears.

      To use another item as the Condition's value, choose Select Item. A list of the items in the worksheet appears and you can select an item from the list.

      If the selected item for the Condition has Parameters defined for it, you can choose the option Select Parameter from the drop-down list to select an existing Parameter for the item.

      If the Condition's Parameter definition include the option for selecting multiple Parameters, you can choose Select Multiple Values from the drop-down list. A list of data values appears and you can select the ones you want.

      You can also create new Parameters for the item by selecting New Parameter from the drop-down list. The dialog for creating new Parameters appears.

      NOTE: If you use Parameters in a Condition, the Parameter appears in the formula with a colon in front of it, such as ":myParameter." If you are using calculations, the calculation appears with an equals sign in front of it so Discoverer knows it is a calculation The Condition will then substitute the results of the calculation for the item or value where you specified a calculation. Using the equals sign you can also type a calculation directly into the Item box or Value box, such as "=Profit.SUM = Sales.SUM".

    2. If you are dealing with text and want the Condition to match the uppercase and lowercase characters in the text, click the box for Match Case. For example, if you want the Condition to filter the data to find all "Widgets" but not "widgets," click the Match Case box.

    3. Click OK. The new Condition appears in the Conditions dialog and is turned on ready to be applied to the data.

    4. Click OK in the Conditions dialog to see the data that meets the Condition.


      Condition Operators

      To create a Condition, you use a Condition operator to produce the statement. The following table lists the operators and some examples.

      NOTE: Put Text in Single Quotes: When you create a Condition with text for the value, the text must be enclosed in single quotes. For example, in the Condition Region = `Central', the text value, `Central', must be enclosed in single quotes.

      Condition Operator  Meaning  Examples 

      Equals 

      Region = `Central'
      Finds data in only the Central Region. 

      <> 

      Not equal 

      Region <> `Central'
      Finds data in all regions except Central. 

      Greater than 

      ProfitSUM > 10000
      Find all data if Profit Sum is greater than 10000

      Sales_Date > 01_JAN_99
      Finds all sales dates after January 1, 1999. 

      Less than 

      ProfitSUM < 10000
      Find all data if Profit Sum is less than 10000.

      Sales_Date < 01_JAN_99
      Finds all sales dates before January 1, 1999. 

      <=  

      Less than or equal to 

      ProfitSUM <= 10000
      Finds all data if Profit SUM is less than or equal to 10000.

      Product_Name <= `M'
      Finds all products with names from A to M. 

      >= 

      Greater than or equal to 

      ProfitSUM >= 10000
      Finds all data if Profit SUM is greater than or equal to 10000.

      Product_Name >= `M'
      Finds all products with names from M to Z. 

      LIKE 

      Similar to (uses wildcard matching) 

      Name LIKE `A_'
      Finds all two-letter names beginning with the letter A. The underscore (_) sign matches a single character.

      Name LIKE `%ING'
      Finds all names ending with the letters ING. The percent symbol (%) matches multiple characters. 

      IN 

      Contains one or more values 

      City IN (`Boston', `Los Angeles', `New York')
      Finds data from Boston, Los Angeles, New York. 

      IS NULL 

      Contains no data (not even zero) 

      Commission IS NULL
      Displays data only when commission has no value. 

      IS NOT NULL 

      Contains some data (even zero) 

      Commission IS NOT NULL
      Displays data when commission has any value. 

      NOT IN 

      Is not contained in one or more values 

      City NOT IN (`Boston', `Chicago')
      Finds all data except data that contains Boston or Chicago. 

      BETWEEN 

      A value lies between two values 

      Profit BETWEEN 1000 AND 2000
      Finds data that contains profits greater than or equal to 1000 or less than or equal to 2000. 

      NOT BETWEEN 

      A value lies outside of two values 

      Profits NOT BETWEEN 1000 AND 2000
      Finds data that contains profits less than 1000 or greater than 2000. 

      NOT LIKE 

      Not similar to 

      Name NOT LIKE `A_'
      Finds all names not beginning with A.

      Name NOT LIKE `%ING'
      Finds all names not ending in ING. 

      != and ^ = and <> 

      Not equals 

      Region! = `Central'

      Finds all regions except Central.

      Note: These three operators have the same meaning because all three are used by different programming languages to mean "not equals." Pick the one you are most comfortable using. 

      Grouping Multiple Conditions

      You can group multiple Condition statements. Conditions consisting of multiple statements are connected using the AND and OR operators. You can also nest statements, so one statement is contained within the definition of another statement.

      NOTE: There isn't a NOT operator, but you can create negated Conditions by using complementary operators.

      Examples:

        Find data from stores with profits greater than $3000 in 1995.

        The Condition statement is: Profit SUM>3000 AND Year=1995. Data from other years and from stores with less profits is not displayed.

        Find the data from all the stores in California, plus all the stores that have profits of $3000.

        The Condition statement is: State='CA' OR Profit SUM>3000. The data display shows data from all the stores in California regardless of profits, and all those from any state with profits in excess of $3000.


        To group multiple Conditions:
        1. In the New Condition dialog, click the Advanced button. The Advanced Conditions dialog appears.


          Discoverer adds Insert buttons for New Item, And and Or. You use these buttons to create the advanced Condition.

        2. Create the first line of the Condition. In the example above it is Calendar Year IN 2000.

        3. Click the New Item button to add another line to the Condition statement.


        Notice the new Group column added at the left side of the dialog. The Group column indicates how the statements are grouped by the operator. By default, when you first write multiple statements they are grouped with the logical AND operator. To change the group operator to OR, NOT AND, or NOT OR, click the drop-down menu next to it.

      • Create the second line of the Condition.

        Discoverer displays the formula at the bottom of the dialog so you can verify that the statement's logical construction is correct.

      • Click OK to save the multi-statement Condition.

    NOTE: You can drag Conditions and items on the dialog. Dragging Condition A onto Condition B replaces Condition B with Condition A. You can also select Copy Condition from the Item drop-down list. In that case the values of the copied Condition replace the values of the selected Condition.

    The operators can also be "nested" to several levels to group multiple Conditions. For example, the Condition to find data from stores with costs greater than $1000 in 2000 or from stores with costs greater than $1000 in the East sales region for any year is: Cost>1000 AND (Region='East' OR Year=2000).


    To nest multiple Conditions:
    1. Click the column handle next to the group operator.

    2. Click the And or Or button to add another group to the Condition.


      The formula at the bottom of the dialog shows the new statement construction.

    3. Select the Item, Condition, and Value as you did for the other lines of the Condition.

      NOTE: Using the AND and OR operators can be tricky especially when grouping statements. Check the data carefully to see if the Condition produces the desired result.

      NOTE: If you delete a Condition, the Undo button becomes active, so you can restore it if you need to. Undo only works after a deletion.

    4. Click OK to save the multi-statement Condition.

    Applying Conditions to Worksheets

    Click OK to apply the Condition to the data and see the results.

    Editing and Deleting Conditions

    If a Condition statement does not find the exact data that you want, you can edit the statement. For example, if the statement finds data for 1998, but your database now includes data from 1999, you can edit the Condition to update it to find the newer data.

    Deleting a Condition removes it permanently from the workbook. However, because you can turn Conditions on and off, you may not want to delete a Condition in case you'll need it in the future.


    To edit a Condition:
    1. Choose Tools | Conditions, or click the Conditions tool on the Toolbar. The Conditions dialog appears.

    2. Select the Condition in the Conditions dialog.

    3. Click the Edit button. The Edit Condition dialog appears.

      NOTE: You cannot edit Conditions created by the Discoverer Administrator. If you select one of these Conditions, the Edit button changes to Show. You can click the Show button to review the Condition and see its formula, but you cannot make changes. In addition, advanced Conditions containing subqueries created in Discoverer 3.1 cannot be reviewed or edited. A message tells you that the Condition cannot be reviewed or edited. You can still turn these Conditions on and off, however, to analyze your data in the way you want.

    4. Make the changes you want to the Condition.

    5. Click OK. The Condition is now edited.

    6. To apply that edited Condition to the data, make sure it is checked on and click OK.


      To delete a Condition:

    7. Choose Tools | Conditions, or click the Conditions tool on the Toolbar. The Conditions dialog appears.

    8. Select the Condition you want to delete.

    9. Click the Delete button. Discoverer removes the Condition from the list.


  • Oracle
    Copyright © 2000 Oracle Corporation.

    All Rights Reserved.

    Contents

    Index