Edit the formula in the Calculation field to replace each parameter value in the Enter a suitable name for the new calculated item in the Name field. Click the Content Type attribute and choose FILE from the drop down list.

Creating and Maintaining Calculated Items 11-13 Figure 11–5 PLSQL Functions dialog: Functions tab 2. Click New and specify the function attributes. 3. Click Validate to check the validity and accuracy of the information you have entered. 4. If the function is invalid, correct the attributes and click Validate again. 5. optional If the function accepts arguments: a. Display the PLSQL Functions dialog: Arguments tab . b. On the Arguments tab, click New and specify the argument attributes. Figure 11–6 PLSQL Functions dialog: Arguments tab 6. Click OK when you have finished defining the function. The custom PLSQL function is now registered for use in Discoverer. 11-14 Oracle Fusion Middleware Administrators Guide for Oracle Business Intelligence Discoverer

12

Creating and Maintaining Conditions 12-1

12

Creating and Maintaining Conditions This chapter explains how to implement conditions using Discoverer Administrator, and contains the following topics: ■ What are conditions? ■ What are the different types of condition? ■ How to create simple conditions ■ How to create advanced conditions ■ How to edit conditions ■ How to edit condition properties ■ How to delete conditions ■ Example conditions ■ About outer joins and the DisableAutoOuterJoinsOnFilters registry setting ■ How to create row level security using a mandatory condition ■ How to enable summary folders if a source folder includes a mandatory condition What are conditions? Conditions filter worksheet data, enabling Discoverer end users to analyze only the data they are interested in. For example, you might want to give Discoverer end users access to data for 2007, but not 2006 or 2005. You also use conditions to restrict access to sensitive data. By imposing mandatory conditions, only non-sensitive data is made available to Discoverer users see What are the different types of condition? . You can make sure that Discoverer end users only see the data that you want them to see. As a Discoverer Administrator, you can anticipate commonly used conditions and make them available to Discoverer end users so that they can apply them in worksheets, and work efficiently. Note : Discoverer Plus users can also create their own conditions. About condition categories Conditions are categorized as follows: ■ Simple conditions - these contain a single condition statement. For example, ’display data where year = 2001’. 12-2 Oracle Fusion Middleware Administrators Guide for Oracle Business Intelligence Discoverer ■ Advanced conditions - these contain two or more condition statements. For example: display data where year = 2001 AND quarter = 1 AND region = south. ■ Nested conditions - these contain condition statements that are defined within other condition statements. For example: display data where year = 2001 AND region = north OR region = south here, the OR clause is nested within the AND clause. ■ Advanced nested conditions - these contain two or more condition statements and also include condition statements defined within the advanced condition. For example: display data where year = 2001 AND quarter = 1 AND region = south AND region = north OR region = south here as in the nested example, the OR clause is nested within the AND clause As an alternative to creating advanced conditions, you might want to create two or more single conditions and apply them at the same time; Discoverer users can then be more selective about which parts of the condition they use. Note: There can be subtle differences between applying advanced conditions and equivalent multiple single conditions for more information, see Oracle Fusion Middleware Users Guide for Oracle Business Intelligence Discoverer Plus. How do conditions work in Discoverer? Conditions work in Discoverer by matching condition statements against worksheet data so that: ■ data matching your condition statements is displayed in workbooks ■ data not matching your condition statements is not displayed in workbooks For example, you might want to limit the display of data to the last two years of sales. Or, you might want to see the data for only two types of sales items. Each of these tasks involves filtering the data to find information that meets the conditions. What are the different types of condition? There are two types of condition: ■ mandatory condition ■ optional condition You create mandatory and optional conditions in the same way. However, note the following: ■ mandatory conditions are always applied to a worksheet that contains one or more items from the folder that contains the condition. Discoverer Plus users are not notified of mandatory conditions and cannot turn them off. For example, you might 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. ■ optional conditions can be turned on or off as required by Discoverer Plus users. They can also view a condition’s formula, but they are not allowed to edit the formula. Creating and Maintaining Conditions 12-3 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 relating to specific sales regions. The table below shows further differences between mandatory and optional conditions: Note : If you create a complex folder from items in a folder that contains a mandatory condition, the results in the complex folder are restricted by the mandatory condition on the original folder. You can see any mandatory conditions that impact a complex folder using the Components tab of the complex folder’s Properties dialog. How to create simple conditions You create a simple condition when you want Discoverer end users to filter worksheets in a new way. You add the condition to a folder so that Discoverer end users can apply the condition when using workbooks based on the folder. For example, you might want to create an optional condition that filters data to display results for the current year, because Discoverer end users might only be interested in data for that year. Or, you might want to restrict access to sensitive data by imposing a mandatory condition on a particular area of data see What are the different types of condition? . To create a single condition:

1. On the

Workarea: Data tab , do one of the following: ■ select the folder in which you want to create the condition ■ select the item that you want to form part of your condition 2. Choose Insert | Condition to display the New Condition dialog . Mandatory condition Optional condition Always applied to the results of a folder. Only applied to the results of a folder if selected in Discoverer Plus. Used by the Discoverer manager to permanently restrict the rows returned by a folder. Provided by the Discoverer manager as a shortcut to help users build conditions more easily. Invisible in Discoverer Plus. 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. Affects the result set in the database of the folder definition in the EUL. Does not affect the result set in the database of the folder definition in the EUL because an optional condition is only used when applied 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. 12-4 Oracle Fusion Middleware Administrators Guide for Oracle Business Intelligence Discoverer Figure 12–1 New Condition dialog Note: If you choose Insert | Condition without first selecting a folder or item, Discoverer prompts you to choose a folder or item before displaying the dialog.

3. optional To have Discoverer generate a name for your conditions automatically,

select the Generate name automatically check box. Note: By default, Discoverer Administrator creates a default condition name for the condition, based on the condition itself. However, you can specify your own name for the condition.

4. optional To specify your own name for the condition:

a. Clear the Generate name automatically check box.

b. Enter a name for the condition in the Name field.

5. optional Enter a brief description of the condition in the Description field.

The text entered here is displayed when the condition is edited in Discoverer Administrator or when the condition is highlighted by end users.

6. Specify the type of condition from the Type drop down list as follows:

■ select Optional if you want Discoverer end users to be able to turn the condition on or off ■ select Mandatory if you want the condition to always apply 7. Define the condition statement in the Formula area as follows:

a. Choose what item or calculation you want to filter the data on using the Item

drop down list. For example, choose Year if you want to display data for a particular year. To create a calculation that you want to filter data on click Create Calculation... for further information, see Chapter 11, Creating and Maintaining Calculated Items .

b. Choose how to match data against the item using the Condition drop down

list. For example, choose the greater than symbol to filter data where the item value is greater than a particular number.

c. Define what data or items you want to match against using the Values field.

For example, enter 2002 to look only at data for the year 2002. If you created a list of values for the item, these items appear in the drop down list for more information about lists of values, see Chapter 9, Maintaining Items and Item Classes . To create a calculation that you want to filter data on click Create Calculation.... To choose an item that you want to match against click Select Item... and select an item from the list. Creating and Maintaining Conditions 12-5

8. Specify whether to match the case of text data using the Match Case check box as

follows: ■ select the Match Case check box to make the condition case sensitive ■ clear the Match Case check box to make the condition case insensitive For example, when the Match Case check box is selected, the match value ’New York’ would not return data for ’new york’. 9. Click OK do save the details and close the New Condition dialog. The new condition is displayed on the Workarea: Data tab . When Discoverer users access this business area, they will see this condition item in a folder. Note that seeing a condition in the folder does not mean that the folder is filtered. The end user must select and use the condition in a workbook. Note : When you create a condition based on an analytic function a function that computes aggregate values based on a group of rows, you must designate the condition Type as optional for more information, see What are the different types of condition? . If you choose mandatory, a message is displayed informing you that analytic functions are not allowed in mandatory conditions. How to create advanced conditions Advanced conditions are conditions that contain more than one condition statement. For example, if you want to filter data for the city New York in either 1999 or 2000, you might create the condition City = New York AND Year = 1999 or 2000. You could then nest an existing condition within the existing advanced condition. For example, where Department = Video AND Rental Profit 100. In Discoverer, it is easy to add as many condition statements as you want, enabling you to build powerful condition items. To create an advanced condition:

1.

Create the first condition statement by following the instructions in How to create simple conditions 2. To add more condition statements, click Advanced. Figure 12–2 New Condition dialog Advanced 12-6 Oracle Fusion Middleware Administrators Guide for Oracle Business Intelligence Discoverer Discoverer adds buttons for Add, Delete, And, Or and Not. You use these buttons to create the advanced condition. 3. Build the advanced condition as follows: a. Click Add to insert a new condition statement. b. Specify the item for the new condition statement as follows: ■ Select the drop down list in the Item column and choose an item from the list of items displayed. ■ Select the drop down list in the Item column and choose the Create Calculation option to create a calculation to include in the advanced condition. ■ Select the drop down list in the Item column and choose the Copy Condition option to include a copy of an existing condition in the advanced condition. The copy can be edited as it is a copy of the original condition. ■ Select drop down list in the Item column and choose the Select Condition option to include an existing condition in the advanced condition. If you select an existing condition, it cannot be edited here. a. Specify the condition and value for the new condition statement. b. Specify how you want to combine the condition statements. Note: You can use the handles next to each condition statement to highlight a condition statement and perform the following actions: ■ click a group and click AND to specify that all condition statements must be met for the condition ■ click a group and click OR to specify that one of the condition statements must be met for the condition ■ click a group and click NOT to specify that no condition statements must be met for the condition ■ click Delete to remove condition statement lines from the condition. ■ drag and drop a handle next to a condition statement to reposition the condition statement in a nested hierarchy. ■ double click a group to change from AND to OR or vice versa Note: If you reposition a condition statement, it can affect the order in which the condition statement is applied within the advanced condition that is, nested condition statements are applied first. 4. When you have finished, click OK to save the advanced condition and close the dialog. The new condition is displayed on the Workarea: Data tab . When Discoverer users access this business area, they will see this condition item in the business area folder. How to edit conditions You edit a condition to change the way that it behaves. For example, you might want to: ■ change the name of a condition ■ change the data being returned by the condition