BO XI R2 - Advanced Universe Design

Embed Size (px)

Citation preview

BO XI R2 Developer Business View Manager

BO XI R2 Developer Advanced Universe Design

Author: Lakshmi Nair ([email protected])16 March 2010 TCS Public 16 March 2010 1

AgendaThe agenda of the training material is to explain only certain features of the universe development. The course material covers: Introduction to Universe Joins Hierarchies Different types of Restriction Creating Filters and Prompts Customization in Prompts Dynamic Table Selection Custom Settings in Parameters Best Practices for Universe Development

16 March 2010

2

What is Universe ? Universe is a special semantic layer that isolates you from the technical complexity of the database. It maps to the data in the database but uses terms that describe your business environment. It provides an easy access to use and understand the interface for non technical Web Intelligence users to run queries against the database to create reports and perform data analysis.

16 March 2010

3

Schematic diagram of Universe Designer

16 March 2010

4

Role of the Universe The role of the universe is to present a business focused front end to the SQL structures in the database. The diagram shows the role of the objects as the mapping layer between a database schema and the Query work area in Web Intelligence, that the users use to create queries.

16 March 2010

5

Joins Join is a condition that links the data in separate but related tables. It is used to avoid Cartesian Product. Drag from one column of table A and join it manually to other column of table B. The user gets an option to define the cardinalities (1..*, *..1)

DOUBLE CLICK THE JOINS16 March 2010 6

Layout of Joins Based on the requirement of the report, the user can define the joins and the cardinalities. The cardinalities should be logically defined or less there are chances of fan traps and chasm traps.

EQUI JOIN

DETECT CARDINALITIES

16 March 2010

7

Different Types of Joins (EQUI / OUTER)EQUI JOIN OUTER JOIN (LEFT/ RIGHT)

Resulting data set limit to values common to column A and column B of Table1 and Table 2

Resulting data set will limit to All values in table country and only matching values in State.

16 March 2010

8

Different Types of Joins (THETA / COMPLEX)THETA JOIN COMPLEX JOIN

COMPLEX Joins have a combination THETA Joins link tables with based on relationship other than equality.16 March 2010 9

of multiple joins and conditions.

Different Types of Joins (SHORTCUT) SHORTCUT JOINS Shortcut joins in a universe represent an alternate path to improve performance of queries by not taking into account intermediate tables. These joins cannot be used to resolve loops.

16 March 2010

10

Shortcut JoinsIf A-B-C-D tables are defined in a context, then if objects from A and D are dragged in the report, the query includes the joins from all the rest of the tables (A,B,C,D). This leads in restriction of records. But if shortcut joins are made between A and D and the objects are dragged from only A and D then the query includes the joins from only A and D tables. In this way the records will not get filtered out due to unnecessary joins coming into picture. This implementation is explained with an example: The context Country-City-State is defined for the join made in the universe. There is no direct join between Country and State.

16 March 2010

11

Direct Joins in WEB-I Report When the objects from Country and State is dragged in the report, as there is no direct join the join between country and city tables get into the picture. This results in additional restriction of records. The results of the query generated is shown in the SQL Viewer of the WEB-I Report.

16 March 2010

12

Shortcut Join in WEB-I Report To avoid unnecessary joins shortcut joins is used between country and state tables. So when the same objects are dragged in the WEB-I Report, the joins between country and city and city and state doesnt come into picture. Shortcut joins when defined in the universe always takes precedence over the rest of the joins.QUERY IN WEB-I REPORT

SHORTCUT JOINS DEFINED IN UNIVERSE

16 March 2010

13

Hierarchies Hierarchies are used to display the level of data. Hierarchy can be assigned with n x levels. Once can drill up, drill down and drill through the hierarchy defined in the universe. For e.g. Display of cities under a state and states under a country. Click on Tools-Hierarchies..

16 March 2010

14

Custom hierarchies in Universe Hierarchies can be default or custom defined. Click on the custom hierarchies and Click New and name the hierarchy. Drag the objects needed to view in hierarchical format to the right panel and shift the order of the requirements.

16 March 2010

15

Specifying the order of hierarchyREMOVE THE OBJECTS NOT TO BE DEFINED IN HIERARCHY

SHIFT THE ORDER

16 March 2010

16

Drill Applied in WEB-I Report Once the hierarchy is defined in the universe. Check the report to see if the objects can be drilled up and down as per the hierarchy defined.

DRILL ENABLED

16 March 2010

17

Drill Down in WEB-I Report as per Hierarchy in Universe On clicking the object to drill down it displays the corresponding products under that account.

HOVER TO THE HYPERLINKS AND A MESSAGE GETS DISPLAYED TO CLICK ON THE VALUE TO DRILL DOWN FURTHER.

16 March 2010

18

Drill Up in WEB-I Report On further drill down, it displays the customers associated to that product. If the user wants to drill up to the higher level then he can click on the arrow indicated to drill up to the product and account.

DRILL UP THE HIERARCHY

16 March 2010

19

Different types of Restrictions Restrictions are defined as :Hardcoded Restrictions Indirect Restrictions Prompts Role Based Access Restriction

16 March 2010

20

Hardcoded Restriction This restriction is given at the object level by adding condition in the Where textbox. As per the best practice the restrictions should not be given at the object level.

16 March 2010

21

Indirect Restriction This restriction is given by using condition defined separately in the universe. Indirect restrictions gives the flexibility in adding the where clause in reports.

CLICK HERE TO GO TO THE QUERY EDITOR

16 March 2010

22

Prompts Prompts allows the user the flexibility to add the values and query for the corresponding values at the run time. The syntax of the prompt is :

@Prompt (Prompt Text, A/N/D, [object], mono/multi, free/constrained, persistent/not_persistent, default value, User:0)Prompt Text A/N/D [object] Mono/Multi Free/Constrained Persistent/Not_Persistent Default value User:0 - Message displayed to the user - Data type of the object is alpha numeric, numeric or date - Custom object displaying list of values or values of existing object - The selection of options will be single or multiple - Type of selection will be forced or list of values will be displayed to the user. - Indicates if the previous value selected by the user should be shown the next time when he runs the report. -Static value which will be displayed always when prompted. - Order in which the specific Prompts should be displayed.

16 March 2010

23

Prompt Creation in Universe Create a filter and add the syntax as shown in the screenshot.

16 March 2010

24

Display Prompt in WEB-I Report Once the prompt is created in universe, drag the filter in the report to see the results.

16 March 2010

25

Role Based Access RestrictionRole Based Access Restriction is restriction applied at the group level for Table Mapping, Row and Object. The implementation of the same is shown with the example of users belonging to a group B1810. If users belonging to the Group B1810 logs into the Infoview Portal and runs the report, then he should see unrestricted data. But rest of the users from different groups other than Group B1810 should see restricted data set. This level of restriction can be applied at Universe level. Table mapping, object level restriction and row level restriction can be applied at Universe level for different groups To apply this restriction, example of PERSON table is taken which has the details of the name, id of the person along with the indicator which tells if the record of the person is sensitive. If the sensitive_ind=Y, then the record is a sensitive data else its a non sensitive data. Another view is created PERSON_VIEW which is the view of Person Table but has a condition that sensitive_ind=N16 March 2010 26

Data in the DatabasePERSON TABLE: WITH SENSITIVE_IND =Y,N RESULT SET:10 RECORDS

PERSON_VIEW WITH SENSITIVE_IND=N RESULT SET: 7 RECORDS

16 March 2010

27

Manage Access Restriction Click on the Manage Access Restriction.

ON CLICK OF MANAGE ACCESS RESTRICTION A POP UP APPEARS

PERSON AND PERSON_VIEW TABLES

16 March 2010

28

Assigning Groups Click on Add user or group. Select the group and add it to the right panel. Click OK.

16 March 2010

29

Create New Restriction Once the group is added , create new restriction to assign to the group. Click on New Name the Restriction as SENSITIVE_RES and click on Table Mapping tab.

16 March 2010

30

Creating Table Mapping Restriction Click on Select to add the corresponding tables. Here the Original Table will be PERSON_VIEW and the Replacement Table will be PERSON.

16 March 2010

31

Assign the Status of the Restriction This means that when user who belongs to B1810 group logs into the report, he sees unrestricted data with the table PERSON. But when rest of the users of other groups logs into the report, he sees data from the table PERSON_VIEW .This view will only display records with SENSITIVE_IND=N. In this way the restriction can be applied globally for certain set of groups. This type of restriction is called ROLE BASED ACCESS RESTRICTION.

16 March 2010

32

Assign the Restriction to the Group Once the restriction is created, assign the restriction to B1810 group by dragging it to the right panel

.

16 March 2010

33

Results Displayed in WEB-I ReportLog on to the report and see the difference between sensitive user and nonsensitive user.

NON SENSITIVE USER- RESTRICTED ACCESS RESULT SET: 7 RECORDS

SENSITIVE USER- B1810 UNRESTRICTED ACCESS RESULT SET: 10 RECORDS

16 March 2010

34

Row Level Restriction Row level restriction is also applied in the same way as table mapping restriction. Create a new restriction in the same manner and add a restriction which will restrict the number of rows. Tag this restriction to a particular group. When the user who is a member of that group logs into the report sees restricted set of data.

16 March 2010

35

Display Row Restriction in WEB-I Report Once the restriction is applied, log on the report as the user who is the member of B1810. It displays only the rows whose SENSITIVE_IND=Y

16 March 2010

36

Object Level Restriction Object level restriction is also applied in the same way as table mapping restriction and row level restriction. Create a new restriction Object_Restriction and add the object SENSITIVE_IND. Assign the object level restriction to B1810 group. When the user who belongs to this group logs in the report, he will not be able to see the object in the Data Panel.

16 March 2010

37

Display Object Restriction in WEB-I ReportWhen the user bf7 who belongs to B1810 group logs in the report, he is not able to see the object SENSITIVE_IND in the PERSON CLASS.

16 March 2010

38

Data Restriction Data Restriction can also be provided at a group level. Based on the groups, the row count generated in the report can be dynamically restricted. The implementation of the same is shown with an example. Group B1810 is set to show the data with row count=2 whereas rest of the groups are allowed to show the data with row count=10. This settings is done in the universe parameters in Controls tab. Create a new restriction Data_Restriction and click the Controls tab and limit the result set to 2.

16 March 2010

39

Assign Data Restriction to the Group Assign the Data_Restriction to B1810 group. When the user bf7 belonging to B1810 logs into the report, the report fetches only 2 rows as the restriction has limited the result set to count 2. When any other user belonging to rest of the groups logs into the report, the report fetches result set of 10.

16 March 2010

40

Display of Data Restriction in WEB-I Report Check the difference in display by logging in to the report with two different users.

Administrator user with data restriction=10 BF7 user with data restriction=2

16 March 2010

41

Different Styles of Prompts There are different styles of Prompts: Free Style Prompt List of values Prompt Date Prompts Cascading Prompt Nested Prompts

16 March 2010

42

Free Style Prompt The user is forced to type the value in the prompt text box to generate the report. Syntax: @Prompt (Prompt Text, A/N/D,, mono/multi, free, persistent/not_persistent, default value, User:0)

FREE STYLE APPLIED IN THE REPORT16 March 2010 43

List of Values Prompt The user is prompted to select the values from the list of values drop down for that object. Syntax: @Prompt (Prompt Text, A/N/D, [object], mono/multi, free/constrained, persistent/not_persistent, default value, User:0)

LIST OF VALUES APPLIED IN THE REPORT16 March 2010 44

Date Prompts The user is prompted to select the value from the calendar Syntax: @Prompt (Prompt Text, D, [object], mono, free, persistent/not_persistent, default value, User:0)CLICK HERE TO PROMPT FOR THE CALENDER

DATE APPLIED IN THE REPORT

16 March 2010

45

Cascading Prompts Cascading Prompts are top to bottom approach. This style is used when the list of values for a prompt exceeds >300.

16 March 2010

46

Implementation of Cascading Prompts To create a cascading prompt which will narrow down the list of values of the customer based on the product. Step1: Shows the values in the table Step 2: Go to Tools-List of values-Create cascading List of Values..STEP 1 STEP 2

16 March 2010

47

Generate LOV for Cascading Prompts Step 3: Drag the class and the objects for which the cascading prompts have to be made. Step 4: The objects can be moved up and down as per the hierarchy to be created in the prompt. Once the order is defined click on Generate LOVs.

STEP 3

STEP 4 MOVE THE OBJECTS

16 March 2010

48

Create Cascading Prompts Step 5:Once the Generate LOVs is clicked, the pop screen appears which states that Cascading list of values is generated successfully. Click OK and check the report. Step 6: Create a Prompt called Customer and call the object Customername in the list of values section: COMPANY.CUSTOMERNAME=@Prompt('Select Customer',mono,'Company\Customername',constrained,not_persistent,,User:0)

STEP 5

STEP 6

16 March 2010

49

Display Cascading Prompts in WEB-I Report

16 March 2010

50

Nested Prompts Nested Prompts are bottom to top approach. The selection is drilled from the lower level. The figures shows the look and feel of nested prompt. Nested prompts are generally used if the list of values exceed >300. The user should enter the values of the sub prompt to filter down to the list of values displayed in the main prompt. The values displayed in the main prompt will be associated to the values entered in the sub prompts.

16 March 2010

51

Implementation of Nested Prompts To create a nested prompt which will narrow down the list of values of the customer based on the product. Step1: Shows the values in the table STEP 2 Step 2: Create a prompt called ProductSTEP 1

16 March 2010

52

Create Custom Object for Nested Prompts Step 3: Create a custom object called Customername and drag the prompt Product in the where clause. Step 4: Create a Prompt on Customer and use the custom object of Customername in the list of values object.STEP 4 STEP 3

16 March 2010

53

Display Nested Prompt in WEB-I Report Step 5: Use only the prompt of Customer in the Web Intelligence Report. Step 6: The Prompt appears in two levelsSTEP 5 STEP 6

16 March 2010

54

Selection of Values in Nested Prompt Step 7: Enter the list of values of Product first. Step 8: Once the prompt for Product is selected, click on Customer. It will display the list of values of Customer who are associated with ProductSTEP 7 STEP 8

16 March 2010

55

Customization in Prompts In Universe the syntax for the prompt is defined as : @Prompt (Enter the value:,A,class/object, mono, free, {default}, persistent, User; 0) There are different scenarios where the prompts are to be customized. The various strategies and scenarios where the prompts are used in different ways are: DYNAMIC JOINS OPTIONAL PROMPTS DYNAMIC TABLE SELECTION TABLE VALUES IN LOV

16 March 2010

56

Optional Prompts Normally when the prompt does not have default value then the user is forced to select/enter any value to enable the Run Query to run the report. The standard approach to make an optional prompt is to add default value/static value in the prompt syntax. The code snippet provided in this case makes the prompt optional without entering any static value in the prompt. The end-user can execute the query even if he does not enter the values in the respective prompts. Table1.column1=DECODE(@Prompt('Enter Prompt Text:','A',,mono,free,not_persistent,,{' },,User:2),' ',trim(Table1.column1),trim(@Prompt('Enter Prompt Text:','A',,mono,free,not_persistent,,{' '},,User:2))) Here the default value is passed as { } (space) and it is considered as an input parameter to enable the run query. The decode function states that if the user does not enter anything in the prompt text, it retrieves entire result set from Table1.column1 in the database. But if the user enters a specific value in the prompt textbox, it retrieves that value in the report.

16 March 2010

57

Optional Prompt in Universe Once the optional prompt is created in universe. Export it and drag the prompt in WEB-I Report to check if the Run Query button is enabled before entering any values in the prompt selection text box. Run the report without entering any value in the prompt text box. All the values of column PLACE from COUNTRY table will be retrieved in the report.

16 March 2010

58

Display in WEB-I Report for Optional Prompts

ALL THE PLACES FROM COUNTRY TABLE RETREIVED IN THE REPORT.

RUN QUERY ENABLED

16 March 2010

59

Specific Value Entered in Optional PromptOn entering England in the prompt text, the report retrieves only that value in the cell.

SPECIFIC VALUE RETREIVED IN THE REPORT.

VALUE ENTERED IN PROMPT

16 March 2010

60

Dynamic Joins Dynamic joins gives the glimpse of how to switch the joins based on the prompt selected by the user. Based on the prompt selection, the joins between two tables are changed and the report is executed. Here the example of two tables are taken PERSON table and DEPARTMENT table. PERSON table has details of the person and the associated Product Id. DEPARTMENT table has details of Product Id based on the categorization of Manufacturing and Testing.

PERSON TABLE

DEPARTMENT TABLE16 March 2010 61

Creating Custom Object for Dynamic Joins Based on the selection from the list of values, the report is generated with the people associated to manufacturing team and testing team. Create a custom object department which has two values Manufacturing and Testing. Create a join between Person table and Department table and with the prompt syntax.

16 March 2010

62

Dynamic Join SyntaxUNIVERSE PANE JOINS

SYNTAX FOR DYNAMIC JOINS

CUSTOM OBJECT Department USED FOR LOV16 March 2010 63

Display Dynamic Joins in WEB-I Report Check the report for both the prompt selection. Drag product name and person name from person table and department table. On selecting Manufacturing in list of values the report shows the names of the person associated to the product in manufacturing team which is 6 people.

SELECTING MANUFACTURING16 March 2010 64

Display Manufacturing Details in Report On selection of Manufacturing in list of values the report shows list of people in manufacturing department.

16 March 2010

65

Display Testing Details in Report On selecting Testing in list of values the report shows the names of the person associated to the product in testing team which is 2 people.

LIST OF PEOPLE IN TESTING DEPARMENT

16 March 2010

66

Dynamic Table Selection Based on the user selection in the prompt, it dynamically swaps the table and fetches the records in the report. Create a custom object Selection of Place which has the syntax:SELECT 'STATE' FROM DUAL UNION SELECT 'COUNTRY' FROM DUAL

Create a derived table DT_REGION_SELECTION which has the prompt syntax to choose the table selection.

16 March 2010

67

Display of Table Selection in WEB-I Report Drag the object of this derived table in the report and run the query. On Refresh, the prompt pop up to ask the report should generate data of country or state. Based on the selection the relevant table is hit and the report is generated. Select the Table Country and check the result set in the report.

16 March 2010

68

Selecting Table State in LOV The report shows the result set of the names of the state on selecting the table STATE in the list of values.

16 March 2010

69

Prompt Syntax in Table Names Generally the list of values is used to display the values of the objects. The code mentioned here allows the user to select the table name and query the report based on them. The only condition to this sort of query is that the objects related to both the tables should be same. Insert Table Products and rename the table as per the syntax: @prompt('select A Table','n',{'PRODUCTS','DEPARTMENT'},,). Once the table is renamed, drag it to the structure pane and give a business name Table Selection

PRODUCTS TABLE RENAMED

16 March 2010

70

Table Names displayed as LOVThe column PROD_ID is same in table PRODUCTS and DEPARTMENT. Only the values in both the tables are different. Select the object Prod_Id from the class Table Selection in the report. The prompt pops up and shows the two table names in the list of values. Select each of the table name to view different results.

SELECT PRODUCTS IN LIST OF VALUES16 March 2010 71

Display in WEB-I Report

REPORT BASED ON PRODUCT TABLE

REPORT BASED ON DEPARTMENT TABLE16 March 2010 72

Custom Settings in Parameters Universe Parameter settings has 7 tabs: Definition Summary Strategies Controls SQL Links

16 March 2010

73

Definition Tab Definition Tab gives the information of the name of the universe, description and connection to the database

16 March 2010

74

Summary Tab Summary Tab details on the universe statistics and date on which the universe was created and modified. It also details on the author, revision and comments on the universe. Universe statistics show the number of classes, tables, objects, joins, conditions created in the universe.

16 March 2010

75

Strategies Tab Strategies Tab gives information about the strategies to create objects, tables and joins. In designer strategies are of two types: Built-in , External.

16 March 2010

76

Built-In Strategies Built-In Strategies : Built-In Strategies are predefined strategies. Designer uses this strategy for creating objects, joins and tables in the universe. To enable automatic creation select Tools-Options. Select the three checkboxes in Database tab.

16 March 2010

77

External Strategies External Strategy: External Strategies enable the designers to specify from their own strategy for creation of objects, joins and tables. To use external strategy for three components: For Objects: Select InsertCandidate Objects For Joins: Select ToolsAutomatic DetectionDetect Joins For Tables: Insert Tables

16 March 2010

78

Controls Tab Controls Tab gives information about the query limit and time execution of the query.

16 March 2010

79

SQL Tab SQL Tab details limits of the SQL generated in the universe. The options can be checked and unchecked as per the requirements. Generally Warn option prompts up a pop up message in Desktop intelligence report if the query generates Cartesian products. But in Web Intelligence if we need to prevent Cartesian product then the option can be changed to Prevent to display the pop up message.

16 March 2010

80

Links Tab Links Tab is used to dynamically link other universes.

16 March 2010

81

Parameter Tab Parameter Tab is used to configure certain SQL parameters common to most RDBMS to optimized SQL generated. Illustrations for few are shown: Configuring ENDSQL Parameter Configuring COLUMNS_SORT Parameter

16 March 2010

82

END_SQL Parameter END_SQL Parameter is used to audit information related to universe, user and data provider. Add the formula in the Parameter and export the universe. When the user runs the query in the Web Intelligence Report, then he would be able to see the name of the universe, name of the data provider, name of the user and name of the document on which the query runs. The syntax is : /* BO AUDITINFO:User Name-@Variable('BOUSER');Universe Name@Variable('UNVNAME');Report Name-@Variable('DOCNAME');Query@Variable('DPNAME') BOAUDITINFO END*/ BOUSER-Displays the name of the user who logs in the report. UNVNAME-Displays the name of the universe the report accesses. DOCNAME-Displays the name of the report. DPNAME-Displays the query name which the report uses to generate the data. This information is required as an audit information as there will be multiple universes, reports and users in the repository. It may also happen that the same report has multiple tabs each generated by multiple queries. This audit information parameter helps the user to know the information based on the report.

16 March 2010

83

Custom Settings of END_SQL Parameter By default the END_SQL is blank. Once the Value is added, click on Replace to reflect new configuration.

16 March 2010

84

Display of END_SQL Information in WEB-I Report Once the parameter configurations are changed, log on to the report and view the SQL query.

16 March 2010

85

COLUMNS_SORT Parameter COLUMNS_SORT is by default configured as NO in the Parameter tab. If the universe if build from the scratch then its better to do the column sorting configuration to YES and then drag the tables to structure pane and universe pane. In this way the columns will be arranged alphabetically without doing it manually.

16 March 2010

86

COLUMN_SORT in Universe The screenshots shows the difference in display of columns in universe before and after the configuration settings of COLUMN_SORT parameter.

AFTER COLUMN SORT

BEFORE COLUMN SORT

16 March 2010

87

BEST PRACTICES IN UNIVERSE DEVELOPMENT-I Universe name should consist of following components: Universe File Name Universe Long Descriptor Universe Summary should contain: Last updated by: Last updated on: Version Number Alias tables should be prefixed with AT_ Derived tables should be prefixed with DT_ Classes and Objects should have text description Classes and Objects should be replaced with business names. When alias tables are used, then base tables should not be used in the same query. Arrange classes and objects in alphabetical order The integrity checker should parse the objects, joins and show 0 loops. @select and @where functions should be used to optimize the universe. Objects which are not used in reports should be hidden in the universe. Cardinalities should be defined for every join. The associated .LOV files should be exported and imported in case of universe import and export. The list of values should be unchecked if the object does not associate to any list of value.16 March 2010 88

BEST PRACTICES IN UNIVERSE DEVELOPMENT-II The row fetch limit should be applied in the Parameters. Check for the database connection should be done. The END SQL Parameter should be defined for audit purpose. Number of aliases should be restricted to make universe less bulky. The data type of the object should be in sync with the database. The universe should be refreshed and in sync with the database. The design of the universe should meet reporting requirements - but the universe should be designed around the business / application. It is very likely that there will be future request for adhoc use of the universe - and that would mean a lot of changes from the current version. There should not be any object in the universe which has no field and formula assigned to it. The list of values in the prompts should be restricted to 300 values. In case the list of values exceed 300, the use of nested prompts should be made in the universe. The context in the universe should not have any unrelated joins as per the best practices. The surrogate keys, foreign keys and other identifiers should not be exposed to end user. These objects should be hidden in the universe.16 March 2010 89

16 March 2010

90