Monday, 21 September 2015

Creating Analyses and Building Dashboards ( part 7 )


Lab 6: Prompting to Filter Analyses
A dashboard prompt is a special filter that filters analyses embedded in a dashboard. There are two various prompts and this topic discusses the Named and Inline Prompts. You will learn to create a Named Prompt in your dashboard.
The prompt created at the dashboard level is called a Named prompt, because, the prompt is created outside of a specific dashboard and stored in the catalog as a prompt object, which can then be applied to any dashboard or dashboard page that contains the columns, which are specified in the prompt. It can filter one or any number of analyses embedded on the same dashboard page. You can create and save these named prompts to a private folder or a shared folder.
  • A named prompt is interactive and will always appear on the dashboard page so that the user can prompt for different values without having to rerun the dashboard.
  • A named prompt can also interact with selection steps. You can specify a dashboard prompt to override a specific selection step.
    The step will be processed against the dashboard column with the user-specified data values collected by the dashboard column prompt, whereas all other steps will be processed as originally specified.
Inline prompts, are embedded in an analysis and are not stored in the Catalog for reuse. An Inline prompt provides general filtering of a column within the analysis, and depending on how it is configured, can work independently from a dashboard filter, which determines values for all matching columns on the dashboard. An inline prompt is an initial prompt. When the user selects the prompt value, the prompt field disappears from the analysis. To select different prompt values, the user must rerun the analysis. The user's choices determine the content of the analyses embedded in the dashboard.
Creating a Named Dashboard Prompt
Named prompts in the Catalog can be applied to any dashboard or dashboard page that contains the columns specified in the prompt. 
To create a named dashboard prompt, perform the following steps:
1 .
Create a named dashboard prompt for region that specifically filters the data for APAC.
Click New > Dashboard Prompt on the global header and then select the A- Sample Sales subject area.
Screenshot for Step
The Definition pane appears. The Definition pane allows you to add, organize, and manage a named prompt's columns.
You can use column prompts, image prompts (maps), currency prompts, and variable prompts.
The Definition table lets you view high-level information about the prompt's columns.
You can also use this table to select columns for editing or deleting, arrange the order in which the prompts appear to the user, or insert row or column breaks between prompt items.
The Display pane is a preview pane that allows you to view the prompt's layout and design.
Screenshot for Step
2 .
a. In the Definition pane, click the New prompt icon (Screenshot for Step), and select Column Prompt.
Screenshot for Step
b. Select C50 Region as the column for the prompt, and click OK.
Screenshot for Step
c. The New Prompt: C50 Region dialog box appears.
The Prompt for Column field allows you to view information about the column that you selected as the prompt. This appears only for column prompts.
Screenshot for Step
The Label text box allows you to enter a meaningful label that appears on the dashboard next to the prompt. Enter Select a Region: in the the Label text box (add a space following the colon). You can optionally enter a description.
d. Select the operator. Accept the default, which is "is equal to / is in." This field is only for column prompts.
e. The User Input field's drop-down list appears for column and variable prompts and provides you with the option to determine the User Input method for the user interface—in other words, the user will see one of the following: check boxes, radio buttons, a choice list, or a list box.
You use this item in conjunction with the Choice List Values item to specify which data values appear for selection.
For example, if you selected the User Input  method of Choice List and the Choice List Values item of  All Column Values, the user will select the prompt's data value from a list that contains all of the data values contained in the data source.
Accept the default, Choice List.
f. The Options section provides you with the opportunity to constrain values available for selection.
Click the plus sign to expand the Options section. Because you selected Choice List for the User Input field, you must now indicate those values.
Some of your choices include All Column Values, Specific Column Values (where you supply those values),
SQL Results (choose a list of values based on a SQL statement), and so on.
Accept the default, All Column Values.
g. The series of check boxes allows you to restrict the amount of data returned.
Select the Enable user to select multiple values, and Require user input check boxes.
Allowing multiple selection of values lets you choose more than one value (region, for example), and requiring input forces you to enter at least one value.
"Default selection" allows you to select an initial value, and "Set a variable" allows you to create a new variable that this column prompt will populate.
Accept the default, None, for both of these fields.
The New Prompt dialog box should look like this:
Screenshot for Step
h. Click OK.
3 .
The prompt is added to the Definition pane.
Screenshot for Step
Save the prompt in the Regional Revenue folder as Region prompt.
Screenshot for Step
4 .
Test the prompt.
Navigate to My Dashboard - Customer Detail and open it in the Dashboard builder.
Recall that the "Customer Discounts by Region" analysis has a Narrative view associated with it that is specifically set to the value of Americas.
Use Page Options > Edit Dashboard to open the Dashboard builder. Navigate to select Region Prompt from the catalog pane.
Screenshot for Step
5 .
Drag Region Prompt to Column 1, above the "Customer Discounts by Region" analysis.
Screenshot for Step
6 .
Click the Region Prompt properties icon and select Scope > Page. Scope determines whether the prompt applies to the entire dashboard or just this page.
Screenshot for Step
7 .
a. Save and run the dashboard. Initially, the filters for the analysis that you created earlier are assumed; that is, the analysis is filtered for Americas region.
Screenshot for Step
b. Select APAC from your dashboard prompt.
Screenshot for Step
c. Click Apply. The region value changes for this page.
d. Observe the change in the region in the dashboard display:
Screenshot for Step
You can try selecting other values in the prompt. Then click Apply to rerun the dashboard prompt.
Managing Prompts
You can now manage prompts with different options.
  • You can choose to show or hide a prompt's apply and reset buttons. If the designer chooses to hide the apply button, then the specified prompt value is immediately applied to the dashboard or analysis.
  • The prompt Reset button now provides three reset options: Reset to last applied values, Reset to default values, and Clear All.
  • The row-based layout prompt option is added to the prompt editor's "Definition pane". You can now display your prompts in a row or in a column.
1 .
Create an analysis with filters.
a. Create an anlysis with the following columns:
Folder
Column
Time
T05 Per Name Year
Offices>Office Region
D50 Region
Base Facts
1-Revenue
Base Facts
7-Shipped Amount
Screenshot for Step
b. Create filter for T05 Per Name Year and D50 Region. Click the More link for T05 Per Name Year. In the New Filter dialog box, select is prompted as the operators. Click OK.
Screenshot for Step
c. Similarly, create a filter for D50 Region. Your analysis should look like this:
Screenshot for Step
d. Save the analysis as My Regional Stats.
2 .
Create a dashboard prompt for year and region.
Click New > Dashboard Prompt on the global header and then select the A - Sample Sales subject area.
Screenshot for Step
3 .
a. In the Definition pane, click the New prompt icon (Screenshot for Step), and select Column Prompt.
Screenshot for Step
b. Select T05 Per Name Year from the Time folder, and click OK.
Screenshot for Step
4 .
In the New Prompt dialog box, enter the label as "Year: ". Click OK.
Screenshot for Step
5 .
The prompt is added to the Definition table.
Screenshot for Step
6 .
Similarly, add another prompt for D05 Region. In the New Filter dialog box, label the prompt as "Region: ". You should now have two prompts in the Definition table.
Screenshot for Step
7 .
Click the row-based layout at the top and notice that the prompts are laid out horizontally in the Display section.
Screenshot for Step
8 .
Save the prompt in the Regional Revenue folder as My Prompt.
9 .
Select Page 1 row in the Definition table and click the pencil Screenshot for Stepicon to edit the page properties.
Screenshot for Step
10 .
In the Edit Page Settings dialog box, change Prompt Display to Place label above prompt. Deselect the Show Apply button and Show Reset button check boxes. The Edit Page Settings dialog box should look like this:
Screenshot for Step
Click OK. Observe that the buttons have been removed from the Display section. Save the prompt.
Screenshot for Step
11 .
Open My Dashboard and add a new page. Use Page Options > Edit Dashboard to open the Dashboard builder.
Click the Add Dashboard page icon.
Screenshot for Step
12 .
In the Add Dashboard Page dialog box, enter Region Stats as the page name and click OK.
Screenshot for Step
13 .
In the new page, drag My Prompt and My Region Stats from My Folders>Regional Revenue folder, to the dasboard page.
Screenshot for Step
14 .
Save My Dashboard and click Run. The dashboard appears.
Screenshot for Step
15 .
Select 2009 as the year and click anywhere on the dashboard. The query runs immediately and returns with data for only 2009.
Screenshot for Step
16 .
Select EMEA as the Region and click any where on the dashboard. The dashboard refreshes with Year as 2009 and Region as EMEA.
Screenshot for Step
17 .
Select Page Options>Edit Dashboard. Click the Tools icon and select Prompts Buttons on Current Page>Apply Buttons>Show All Apply Buttons.
Screenshot for Step
18 .
Click the Tools icon and select Prompts Buttons on Current Page>Reset Buttons>Show All Reset Buttons.
Screenshot for Step
19 .
Save the dashboard and run it again. This time both the Apply and Reset buttons are displayed.
Screenshot for Step

Using a Presentation Variable
A presentation variable can be created as part of the process for creating a column prompt or a variable prompt. When the presentation varaible is part of a column prompt, it is associated with a specific column and takes on that column's value. It is part of a variable prompt, you define the values that the prompt can have as it is not associated with any specific column. The name and value of the presentation variable is determined by the user when it is initially declared or when it is referenced in the analysis, dashboard, or agent.
Note: You have already created and used a presentation variable when you added a Narrative view to your analysis.
To add a presentation variable using a variable prompt, perform the following steps:
1 .
Create a new variable dashboard prompt that creates a Sales Representative presentation variable.
a. Click New > Dashboard Prompt and select Sample Sales as the subject area.
Screenshot for Step
2 .
Click New > Variable Prompt.
Screenshot for Step
The New Prompt dialog box appears.
Screenshot for Step
3 .
a. Accept Presentation Variable as the default prompt type.
b. In the text box to the right of the drop-down list for the prompt type, enter the same variable that you entered in the Static Text editor, VarSalesRep.
c. Enter Sales Representative Name: in the Label text box.
Screenshot for Step
d. Select Choice List for User Input.
Screenshot for Step
e. Select All Column Values for Choice List Values.
Screenshot for Step
The dialog box should look like this:
Screenshot for Step
4 .
a. Click Select Column and, in the Select Column dialog box, select Sales Person > E1 Sales Rep Name.
Screenshot for Step
b. Click OK. The dialog box should look like this:
Screenshot for Step
Expand the Options section.
5 .
Select Specific Value from the "Default selection" drop-down list.
Screenshot for Step
Click the Select Values icon.
Screenshot for Step
6 .
In the Select Values dialog box, select Angela Richards and then, click OK.
Screenshot for Step
7 .
The New Prompt dialog box should look like this:
Screenshot for Step
Click OK. The newly created variable prompt is displayed in the prompts definition list.
Screenshot for Step
8 .
Save the prompt as SalesRep Variable Prompt in your Regional Revenue folder.
Screenshot for Step
9 .
Click the Preview icon (Screenshot for Step) to preview the prompt.
Screenshot for Step
Close the Preview window.
Using a Presentation Variable in a Static Text View
Create an analysis that uses the VarSalesRep presentation variable in a Static Text view and in a Filter.
A Static Text view adds static text in the results.
1.
Create an analysis by selecting the following columns:
  • Customers > Cust Regions > C50 Region
  • Customers > Cust Regions > C52 Country Name
  • Sales Person > E1 Sales Rep Name
  • Base Facts > 1 Revenue
Screenshot for Step
2 .
Add ascending column sorts in this sequence: C50 Region, C52 Country Name, and E1 Sales Rep Nameas shown below:
Screenshot for Step
The Criteria tabbed page should look like this after adding the sorts:
Screenshot for Step
3 .
Select the Results tabbed page.
Screenshot for Step
4 .
Select New View > Other Views > Static Text.
Screenshot for Step
5 .
Move the Static Text view above the Table view.
Screenshot for Step
Click the Edit View icon on the Static Text view. The Static Text editor appears.
Screenshot for Step
6 .
In the Static Text editor, reference the VarSalesRep variable. Enter the following syntax in the Static Text pane: This analysis is for the Sales Rep @{VarSalesRep}.
The syntax for referencing a Presentation variable is as follows:
@{variables.variablename}[format]{defaultvalue} or @{scope.variables['variablename']}
Where:
variablename is the name of the presentation or request variable

format (optional) is a format mask dependent upon the data type of the variable, for example #, ##0, MM/DD/YY hh:mm:ss. (Note that the format is not applied to the default value.)

default value (optional) is a constant or variable reference, indicating a value to be used if the variable referenced by variablename is not populated
scope identifies the qualifiers for the variable. You need to specify the scope when a variable is used at multiple levels (analyses, dashboard pages, and dashboards) and you want to access a specific value. (If you do not specify the scope, then the order of precedence is analyses, dashboard pages, and dashboards.
Examples:
@{variables.MyFavoriteRegion}{EASTERN REGION}
or

@{dashboard.variables['MyFavoriteRegion']}
Screenshot for Step
Observe that your entry is previewed below the Static Text text box. Click Done.
7 .
Save your analysis as Sales Reps by Region and Country.
Screenshot for Step
Screenshot for Step
Your analysis should look like this:
Screenshot for Step
8 .
a. Select the Criteria tabbed page.
b. In the Filters pane, click the Create a Filter icon and select "Sales Person "."E1 Sales Rep Name ".
Screenshot for Step
9 .
a. In the New Filter dialog box, click Add More Options and select Presentation Variable.
Screenshot for Step
b. In the Variable Expr field, enter the variable name, VarSalesRep. Notice that you can also specify a default for the variable, but in this case the default is driven by the variable prompt, which is set to default to "Angela Richards".
Screenshot for Step
c. Click OK. The filter should look like this:
Screenshot for Step
10 .
Select the Results tabbed page. Because the variable dashboard prompt has not been run, the VarSalesRep presentation variable has not been populated with a value. Because of this, no results from the analysis meet the filter requirement.
Screenshot for Step
Save the analysis.
11 .
Add the analysis Sales Reps by Region and Country and the newly created variable prompt to the Customer Detail dashboard.
12 .
Open the dashboard Customer Detail from the Regional Revenue folder, then click Page Options > Edit Dashboard.
Screenshot for Step
13 .
Add a new column next to Column 1, and then navigate to the Sales Reps by Region and Country analysis and drag it to the new column.
Screenshot for Step
14 .
Navigate to SalesRep Variable Prompt in the catalog pane, and drag the prompt above the Sales Reps by Region and Country analysis. Save the dashboard and run it.
The Dashboard view looks like this:
Screenshot for Step
15 .
Click the Collapse icon for the first column to minimize it.
Screenshot for Step
The dashboard runs and the variable dashboard prompt is preset to the default value, Angela Richards, which in turn appears in the Static Text view as expected and is used to filter the embedded analysis results. The value of a presentation variable is populated by the variable prompt. That is, each time you select a value in the variable prompt, the value of the presentation variable is set to that value.

Click the drop-down list for the dashboard prompt, and select Chris Jones.
Screenshot for Step
Click Apply. The dashboard displays the presentation variable as Chris Jones.
Screenshot for Step
This concludes the topic of Presentation Variables and Filters.
Summary
This tutorial has covered how to build, format, and customize Oracle Business Intelligence (BI) analyses and how to create and update dashboards by utilizing these analyses.
In this tutorial, you have learned how to:
    • Create analyses, add graphs, and work with pivot tables
    • Format analyses and graphs
    • Create and work with several types of views
    • Explore My Dashboard and add a new dashboard page
    • Create a dashboard
    • Create a dashboard prompt
    • Create a variable prompt for a presentation variable
Resources
Credits:
  • Lead Curriculum Developer: Sindhu Rao
  • Other Contributors: Kasturi Shekhar, Nikki Sanger, Rashmi Raj,Dave Granholm
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ps/library/divider.gif

No comments:

Post a Comment