This procedure shows how to achieve the top-N Sales Persons when dimensional data is present in a snowflake layout.
- First create a JDBC connection in the BI Publisher Administration section by going to the url: http://localhost:9704/xmlpserver/and login as “weblogic” user.
- Under the Administration section select “JDBC Connection” under the “Data Sources” sub-section.
- In the JDBC web page select “Add Data Source” button.
- In the “Add Data Source” screen enter the following:
- For the “Data Source Name” enter the name for the connection e.g: “XE”
- For the “Driver Type” select “Oracle 11g”
- For the “Database Driver Class” field leave the default “oracle.jdbc.OracleDriver”
- For the “Connection String” field enter the location and port of the Oracle Database where your BISAMPLE schema exists.
- For the “Username” field enter “BISAMPLE” and for the “Password” field enter “BISAMPLE”.
- Verify your entries with the below screenshot.
- To verify that the entries are correct, click the “Test Connection” button and make sure that “Connection established successfully” appears at the top of the screen.
- Click the “Apply” button to save your changes.
- Your entry will be present in the list as show below:
- In the “Administration” screen menu select New -> “Data Model”
- select “XE” for the “Default Data Source” field, this the JDBC connection we have created above.
- Click the Save icon on the top right corner and save it under the “Shared Folders” -> “11g Shared” -> “BI Reps” folder, enter “SalesRepModel” for the “Name” field.
- Click the “Save” button.
- Click the “Data Sets” option under the “Data Model” panel on the left side.
- Under the “Diagram” tab select “SQL Query” as show in below screen shot:
- Click the “Query Builder” button on the “Create Data Set – SQL” screen.
- In the “Query Builder” Window select the three tables on the left pane i.e. “SAMP_EMPL_D_VH” , “SAMP_EMPL_PARENT_CHILD_MAP” and “SAMP_REVENUE_F” tables.
- Create the foreign key links between the tables.
- Click on the Right White Square next to the “EMPLOYEE_KEY” in the first table then click on the Right White Square next to the “MEMBER_KEY”.
- Click on the Right White Square next to the “ANCESTOR_KEY” in the second table and then on the Right White Square next to the “EMPL_KEY” in the third table.
- Now select the columns from the tables that we would require to display in our reports and which are required to generate our SQL query which constitutes the Data Source.
- Check the “EMPL_NAME” checkbox in the first table, the “MEMBER_KEY” checkbox in the second table and the “REVENUE” checkbox in the third table.
- Click on the “Conditions” link.
- In the “Conditions” Screen, de-select the “MEMBER_KEY” checkbox under the “Show” column.
- For the “REVENUE” row select the “SUM” under the “Function” column.
- Click the “Save” button
- In the “Create Data Set – SQL” Screen enter “topNSQL” for the “Name” field.
- Update the “SQL Query” section with the “DISTINCT” Function so the query is as show in below screen shot.
- Click on the “OK” button to close the window.
- Save the Model by clicking on the “Save” icon and Enter “SalesRepModel” for the “Name” field.
- Now click the xml icon to run the query.
- In the “SalesRepModel” screen select “All” for the “Number of rows to return” then click the “Run” button.
- The select the options “Save As Sample Data” option.
- In the “Diagram” screen select the “New” -> “Report” option as shown in below screenshot.
- In the “Create Report – ” window select the “SalesRepModel” then click the “Next” button.
- On the next screen select “Use Report Editor” and click on the “Finish” button.
- Enter “SalesRepReport” in the “Save As” window and click the “Save” button.
- In the Report Editor as show below select the “Data Table” icon.
- Drag the “EMPL_NAME” and the “REVENUE” columns from under the “DATA_DS” -> “G_1″ folder on the left pane to the “Data Table” as show below.
- Select the Data rows under the “REVENUE” column and select the “Descending Order” icon as shown in below screenshot.
- Click the “Save” icon and enter “SalesRepLayout” for the “Layout Name:” field and click the “Save” button.
- Select the data rows under the “REVENUE” column and select the ($1,234.57) format under the “Data Formatting” from tool bar.
- Select the “Interactive Preview” icon to view your report.
Summary:
As you can observe that achieving the type of report is mainly dependent on how your query is constructed for your data source.
As you can observe that achieving the type of report is mainly dependent on how your query is constructed for your data source.