Presentation is loading. Please wait.

Presentation is loading. Please wait.

TITLE OF PRESENTATION PRESENTER.

Similar presentations


Presentation on theme: "TITLE OF PRESENTATION PRESENTER."— Presentation transcript:

1 TITLE OF PRESENTATION PRESENTER

2 Web Intelligence Advanced #2
Join us as we cover techniques that will help you to successfully build more advanced reports in This Web Intelligence. We will present these concepts: merging dimensions, inner vs. outer joins, and variables & formulas (object types and conversion, basic functions, if-then-else, sum-where, and forall- foreach). Prior experience with Web Intelligence is recommended.

3 Join Types Structured Query Language provides two main methods for joining data from two separate tables Inner Join – includes only those records that have a matching key in both tables Outer Join – includes all records from the primary table, but only those records that have a matching key in the second table. Left or Right Outer indicates which table is considered to be primary

4 Simple Example EMPLOYEE_NO FIRST_NAME LAST_NAME 11111 Eder Roux 22222
Maldwyn Bootsma 33333 Ariston Leone EMPLOYEE_NO CONTRACT_YEAR JOB_CODE 11111 2015 TEACH 2016 22222 COACH

5 Result of Inner Join Only records with a matching key (EMPLOYEE_NO) in both tables are returned EMPLOYEE_ NO FIRST_NAME LAST_NAME CONTRACT_ YEAR JOB_CODE 11111 Eder Roux 2015 TEACH 2016 22222 Maldwyn Bootsma COACH

6 Result of Outer Join All records from EMPLOYEE_MASTER are included with EMPLOYEE_JOBS that have a matching key EMPLOYEE_ NO FIRST_NAME LAST_NAME CONTRACT_ YEAR JOB_CODE 11111 Eder Roux 2015 TEACH 2016 22222 Maldwyn Bootsma COACH 33333 Ariston Leone

7 Filtering Note that filtering can also have an unintended effect
WHERE CONTRACT_YEAR = ‘2016’ EMPLOYEE_ NO FIRST_NAME LAST_NAME CONTRACT_ YEAR JOB_CODE 11111 Eder Roux 2016 TEACH 22222 Maldwyn Bootsma COACH

8 Query in Web Intelligence
How do we know what type of join will be used? Check SQL using the View Script button

9 Checking the SQL Script
SELECT HRS.EMPLOYEE_MASTER.EMPLOYEE_NO, HRS.EMPLOYEE_MASTER.FIRST_NAME, HRS.EMPLOYEE_MASTER.LAST_NAME, HRS.EMPLOYEE_JOBS.CONTRACT_YEAR, HRS.EMPLOYEE_JOBS.JOB_CODE FROM HRS.EMPLOYEE_MASTER, HRS.EMPLOYEE_JOBS WHERE ( HRS.EMPLOYEE_MASTER.EMPLOYEE_NO=HRS.EMPLOYEE_JOBS.EMPLOYEE_NO(+) ) AND ( ( hrs.hesec03a ('EMPLOYEE_MASTER', ( HRS.EMPLOYEE_MASTER.EMPLOYEE_NO ), = 'Y' ) ( 'HMEMP01AFMX') = 'Y' ) ( 'HEJOB01AFMX') = 'Y' ) HRS.EMPLOYEE_MASTER.EMPLOYEE_NO=HRS.EMPLOYEE_JOBS.EMPLOYEE_NO(+) (+) indicates an outer join and is placed at the end of the second (non-primary) table

10 Merging Dimensions How do we build this query?
Show all employees Only include Jobs with Contract Year of 2015 Solution also works for inner joins

11 Example with Lab Data

12 Setting up a Query Limiting Contract Year to 2015
Employees will get lost – no job record for 2015 Solution: Build 2 Queries

13 Create First Query Click Add Query to add a query for Jobs
Right click and choose to Rename this query

14 Add Jobs Query

15 Two Queries – Two Tables
Two separate tables are created Notice Employee No from each query (Employees) (Jobs) And delete this second table Highlight each Employee No. Then right click and choose to Merge them.

16 Right click Variables and choose
Combining the Data We cannot use dimensions from opposite queries Dragging Job Code or Contract Year gives an “incompatible” message Instead, we will convert them to details Right click Variables and choose New Variable

17 Job Code Name: Job Code – Detail Qualification: Detail
Associated dimension: Employee No (Merged) Formula: =[Job Code]

18 Contract Year Name: Contract Year – Detail Qualification: Detail
Associated dimension: Employee No (Merged) Formula: =[Contract Year]

19 Combined Table Tables always “group by” dimensions
Details are considered an extension of a dimension Employee No is merged so its extensions can exist in the same table

20 Watch for WebI Merging For You
Consider the following query:

21 View Script to Reveal 3 Queries
Common dimensions are merged

22 Object Types Dimension Detail Measure
A category of information to be measured Always grouped so that distinct values are shown in tables Detail An attribute of a dimension (or merged dimension) Must be one-to-one with the dimension Measure A measured value that can be summarized by one or more dimensions Automatically aggregated by dimensions included in a table Sometimes we will want to convert dimensions to measures using variables.

23 Formulas Adjust, expand, and customize data
Example: Add a calculated balance column Create a new column to the right of Amount – YTD with Default Open the Formula Editor Formula for selected cell is displayed in the Formula Bar Formula Editor button will bring up advanced screen

24 The formula can be typed or built from the items below.
To insert, items can be double clicked or dragged into the Formula box. Formula text is the same as on Formula Bar Simple math can be used for our balance Descriptive help provides information about how to use functions Objects from queries or variables Library of functions to be used to create our desired result Operators to be used for comparison

25 New Balance Column

26 Formula Notes Cell formula can be shared by placing it in a variable
Formula always starts with equals = Objects & variables use [square brackets] Literal strings use “quotation marks” Concatenate strings with plus + Function Parameters are separated by semi colons ;

27 Example Functions in Expressions
=Sum([Adjusted Budget – YTD with Default]) =Left([Fund];1) =[First Name] + “ “ + [Last Name] =Max(ToNumber([Employee No)]) =ReportName() =“Page “ + Page() + “ of " + NumberOfPages()

28 If… Then… Else… If statements do not use parentheses Example:
=If [Balance Percentage] > .20 Then "Time to spend" ElseIf [Balance Percentage] > 0 Then "Slow down" Else "Stop spending!“

29 Sum Where (out there) Add Where() function to an aggregate function to limit included values Example: =Sum ([Adjusted Budget - YTD with Default]) Where ([Location] <> "33 – Administration")

30 In, Forall, and Foreach Used to calculate values outside of context dictated by cell position within report, group, or table ForAll (dimensions) Removes dimensions from the calculation context Foreach (dimensions) Adds dimensions to the calculation context In (dimensions) Specifies the specific dimensions to use in the calculation context

31 ForAll Example Total Fund budget for all locations:
=Sum([Adjusted Budget - YTD with Default]) ForAll ([Location]) Could also show grand total with: =Sum([Adjusted Budget - YTD with Default]) ForAll ([Fund];[Location])

32 ForceMerge Function Back to the example with separate Employees and Jobs queries Add Contract Salary to Jobs query Shows ok in table because Employee No is merged

33 Removing Employee No If we don’t want to show Employee No, we have a problem The table doesn’t see the link to Contract Salary

34 Use ForceMerge Function
Force the table to follow merged dimension relationship =ForceMerge([Contract Salary])

35 Additional Training If you are interested in other alio WebEx group training sessions, you can view a list of sessions currently available at, If you prefer one-on-one training, please contact your alio support provider directly for cost and scheduling information.  If you have any questions or concerns, please contact alio support at or by direct to

36


Download ppt "TITLE OF PRESENTATION PRESENTER."

Similar presentations


Ads by Google