Download as pdf or txt
Download as pdf or txt
You are on page 1of 58

960 Cognos Analytics: Create Joins

960CLP031419
Contents

• Learning Resources
• 960 Cognos Analytics: Create Joins Presentation
• Explore Cardinality in Cognos Analytics Demonstration
• Job Aid: Join Queries in Cognos Analytics Reporting
• Job Aid: Add Calculations to a Cognos Analytics Report

© 2019 The Ultimate Software Group, Inc. All rights reserved. No part of this document or its content may be reproduced in
any form or by any means or stored in a database or retrieval system without the prior written authorization of The Ultimate
Software Group, Inc. (“Ultimate Software”). Information in this document is subject to change without notice. The document
and its content are confidential information of Ultimate Software and may not be disseminated to any third party. Nothing
herein constitutes legal advice, tax advice, or any other advice. All legal or tax questions or concerns should be directed to
your legal counsel or tax consultant.

UltiPro® is a registered trademark of Ultimate Software. All other company and product names referenced herein are the
trademarks or registered trademarks of their respective holders.

Liability/Disclaimer
Ultimate Software makes no representation or warranties with respect to the accuracy or completeness of the document or
its content and specifically disclaims any responsibility or representation for other vendors’ software. The terms and
conditions of the license, Intersourcing, SaaS, or other agreement regarding the software or services provided by Ultimate
Software, which is the subject of the documentation contained herein, govern this document or content. All company,
organization, person, and event references are fictional. Any resemblance to actual companies, organizations, persons,
and events is entirely coincidental.

960CLP031419 2 of 58
LEARNING RESOURCES
TITLE TYPE

Create Joins in Cognos Analytics Reports Video


Learning Center > Video Channel > Reporting

Join Queries in Cognos Analytics Reporting Job Aid


Learning Center > Content > Reporting> Business Intelligence > Create
and Modify

Add Calculations to a Cognos Analytics Report Job Aid


Learning Center > Content > Reporting> Business Intelligence > Create
and Modify

Cardinality in Business Intelligence Reports Job Aid


Learning Center > Content > Reporting> Business Intelligence > Configure

960CLP031419 3 of 58
Welcome!
960 Cognos Analytics: Create Joins

• Explore Cardinality
• Resolve Cross-Joins Errors

AGENDA
• Merge Queries to Create
Adjacent Columns

Ultimate Software, in its sole discretion, may video and/or record this conference or portions of it, including but not limited to, the Question and Answer sessions and
play said videos and recordings at various times in the future. Any individuals attending or participating in this conference acknowledges this, and consents to the use
in the future by Ultimate Software, at its sole discretion, of the video or recording of his or her attendance or participation and waives any rights or interest in any such
future use.

This presentation and content are for Ultimate Software use only. No part of this presentation or content may be reproduced in any form or by any means or stored in
a database or retrieval system without the prior written authorization of The Ultimate Software Group, Inc. Information in this presentation and content are subject to
change without notice. The presentation and content are confidential information of The Ultimate Software Group, Inc. and may not be disseminated to any third
party. Nothing herein constitutes legal advice, tax advice or any other advice.

© 2018 The Ultimate Software Group, Inc. UltiPro® is a registered trademark of The Ultimate Software Group, Inc.
All other company and product names referenced herein are the trademarks or registered trademarks of their respective holders.

Liability/Disclaimer
The Ultimate Software Group, Inc. makes no representation or warranties with respect to the accuracy or completeness of the presentation or content and
specifically disclaims any responsibility or representation for other vendor’s software. The terms and conditions of the license, Intersourcing, SaaS, or other agreement
regarding the software or services provided by Ultimate Software, which is the subject of the documentation contained herein, govern this presentation or content. All
company, organization, person, and event references are fictional. Any resemblance to actual companies, organizations, persons, and events is entirely coincidental.
Nothing herein should be considered legal or tax advice. All legal or tax questions or concerns should be directed to your legal counsel or tax consultant.

960CLP031419 4 of 58
Explore
LESSON 1 Cardinality

LESSON OBJECTIVES
• Create different types of Joins and compare report output
• Identify best practices for creating Joins

960CLP031419 5 of 58
What is a Join?
• A Join combines the records from two data sets using
common values
• Delivered Business Intelligence packages are modeled with
Joins to meet most reporting needs
• Create Joins only when necessary, for example:
• To report on data from tables that are not joined in the model (for
example, Audit reporting)
• To obtain reporting results that differ from what the model provides

Joins in Cognos Analytics Reporting


• Cognos Analytics Reporting queries pull data from the UltiPro
tables
• Join cardinality defines the relationship between queries
• A Join links queries through
a common data item
• Sometimes linking two data
items is required to obtain
unique results

960CLP031419 6 of 58
Cardinality – Example Relationships
• Supervisor Query and Employee Query

• Typical relationship:
• One supervisor (Izzari) has many employees
• Other relationships:
• Supervisors (Baker) not yet assigned employees
• Employees (Waibel) without a supervisor

Four Join Types


• Inner Join:
• A conventional Join that returns all
matched rows
• Other Join types return unmatched rows:
• Full Outer Join
• Left Outer Join
• Right Outer Join

Important!
Incorrectly configured cardinality can increase report run time from minutes
to hours, and return incorrect or unexpected results

960CLP031419 7 of 58
Inner Join
• At least one matching record is found in both queries (a one-
to-one relationship)
• For example:
• One employee has deduction/benefit types

Employees Ded/Ben Types

Left Outer Join


• All rows of the left query and the matching rows of the right
query display in the report
• For example:
• One employee has zero or more deduction/benefit types

Employees Ded/Ben Types

960CLP031419 8 of 58
Right Outer Join
• All rows of the right query and matching rows of the left query
display in the report
• For example:
• One deduction/benefit type has zero or more employees assigned to it

Employees Ded/Ben Types

• Note: Left and Right Outer Joins are functionally equivalent if the query
order is reversed

Full Outer Join


• Retrieves all data from both queries
• Every row is matched and returned whether or not it is
present in both queries
• Results can be very large because all matched and unmatched rows
are returned

960CLP031419 9 of 58
DEMONSTRATION
Explore Cardinality
Scenario: Create a Cognos
Analytics report that displays the
names of employees who do not
participate in the Deferred
Compensation benefit.

Job Aid: Explore Cardinality in Cognos Analytics


Demonstration

Cardinality Best Practices


• First, determine which query will be your “main” (left-
side) query
• Information from this table must be unique
• Place employee data in the main query

1..1 – one and only one Employee

960CLP031419 10 of 58
Cardinality Best Practices
• Second, determine what you want to see in your report

• 1..n – one or more Deduction/Benefit Codes

• 0..n – zero or more Deduction/Benefit Codes

Cardinality Best Practices


• Examples:
• [1..1] (one and only one Employee) = [1..n] (one or more
Deduction/Benefit Codes)

• [1..1] (one and only one Employee) = [0..n] (zero or more


Deduction/Benefit Codes)

960CLP031419 11 of 58
Cardinality Best Practices
• To retrieve only one transaction per employee use one of the
following:
[1..1] = [1..n]
[1..1] = [0..n]
[1..1] = [0..1]

Cardinality Best Practices


• Improperly created Joins cause poor report performance
• Avoid using the following cardinalities:
[0..n] = [0..n]
[0..1] = [0..1]
[1..n] = [1..n]

960CLP031419 12 of 58
Explore Cardinality in Cognos Analytics Demonstration
Business Intelligence

Report on Deferred Compensation Participation


Use the Administrator Package to create a report that lists the names of active employees in Another
World Electronics who participate in the Deferred Compensation plan.

1. From the side panel, select New, and then select Report.

2. From the Template and Themes page, select Blank and then select OK.
3. From the Source tab, select Add Report Data (+).

4. In the Open File dialog box, navigate to the Administrator Package, select the package, and then
select Open.

• Location: Team Content > UltiPro BI Content > UltiPro BI for Core HR and Payroll >
UltiPro Delivered Packages

960CLP031419 13 of 58
5. Select the + icon in the center of the work area, and then select List.
6. In the Object and Query Name dialog box, select OK to accept the default.
7. From the Source tab, expand the package, and then add data items to the list.

Data Item Location


Company Code Business Layer > Employee Information folder >
Employee query subject
Employee Name (Last Suffix, First MI) Business Layer > Employee Information folder >
Employee query subject
Employee Number Business Layer > Employee Information folder >
Employee query subject
Employment Status Code Business Layer > Employee Information folder >
Employee query subject > Status Information folder
Deduction/Benefit Type Code Business Layer > Employee Information folder >
Employee Deduction/Benefits query subject

8. From the side panel, select the Toolbox icon, expand the Textual section, and add a Row Number
object to the left of the list container.
9. Filter the report.
a. Select a column, and then from the on-demand toolbar select the Filter icon.
b. Select Edit Filters, and then from the Filters dialog box select the Add icon.
c. From the Create Filter dialog box, select Advanced, and then select OK.
d. Complete the filter expression, validate the expression, and then select OK.
e. Follow this process to filter data items.
• Filter Company Code for AWE
• Completed expression: [Company Code]='AWE'
• Filter Employment Status Code for A
• Completed expression: [Employment Status Code]='A'
• Filter the Deduction/Benefit Type Code for DEF
• Completed expression: [Deduction/Benefit Type Code]='DEF'

960CLP031419 14 of 58
10. Select columns not needed for report output and then from on-demand toolbar select the More
icon (ellipsis).
• Company Code
• Employment Status Code
11. From the drop-down list, select Cut.
12. Run the report to HTML format, view the output, and then close the report viewer.

13. Name the report Deferred Comp – No Join, save the report to My Content, and then from the side
panel, select the Home icon.
The Welcome page appears.
It is unnecessary to create and join two queries to obtain this report output because the data items in the
Package are modeled using an Inner Join. However, if you want to determine the names of employees
who do not participate in this benefit, you must create separate queries and then join the queries with
the desired cardinality relationship.

960CLP031419 15 of 58
Report on Deferred Compensation Non-Participation
Create a Cognos Analytics report that lists employees who do not participate in the Deferred
Compensation benefit.

NAVIGATION: Cognos Analytics Welcome Page

1. From the side panel, navigate to the Administrator Package.


• Team Content > UltiPro BI Content > UltiPro BI for Core HR and Payroll > UltiPro
Delivered Packages
2. To the right of the Administrator Package name, select the More icon.
3. From the drop-down menu, select Create Report.
4. From the Templates and Themes page, select Blank and then select OK.

Create an Employee Query


Create a Cognos Analytics query to report on employee data.
1. From the side panel, select the Queries icon, and then select the Add Query icon.

2. Right-click the Query object, and then from the drop-down list select Rename Query.

3. In the Value field, enter a name, and then select OK.


• Value: Employee Query

960CLP031419 16 of 58
4. Select the query object.
5. From the side panel, select the Data icon, and then add data items to the Data Items pane.

Data Item Location


Company Code Business Layer > Employee Information folder >
Employee query subject
Employee Name (Last Suffix, First MI) Business Layer > Employee Information folder >
Employee query subject
Employee Number Business Layer > Employee Information folder >
Employee query subject
Employment Status Code Business Layer > Employee Information folder >
Employee query subject > Status Information folder

6. Filter for the AWE component company and active employment status.
a. From the Data Items pane, drag Company Code to the Detail Filters pane.
b. Complete the filter expression, validate the expression, and then select OK.

• [Company Code]='AWE'
c. From the Data Items pane, drag Employment Status Code to the Detail Filters pane.
d. Complete the filter expression, validate the expression, and then select OK.

• [Employment Status Code]='A'

Create a Deduction/Benefit Query


Create a Cognos Analytics query to report on deduction/benefit type.
1. From the side panel, select the Queries icon, and then select theAdd Query icon.
2. Right-click the Query object, and then from the drop-down list select Rename Query.
3. In the Value field, enter a name, and then select OK.

960CLP031419 17 of 58
• Value: Deduction/Benefit Query
4. Select the query object.
5. From the side panel, select the Data icon, and then add data items to the Data Items pane.

Data Item Location


Deduction/Benefit Type Code Business Layer > Employee Information folder >
Employee Deduction/Benefits query subject
Company Code Business Layer > Employee Information folder >
Employee query subject
Employee Number Business Layer > Employee Information folder >
Employee query subject

6. Filter for the Deferred Compensation Benefit plan.


a. From the Data Items tab, drag Deduction/Benefit Type Code to the Detail Filters pane.
b. Complete the filter expression, validate the expression, and then select OK.

• [Deduction/Benefit Type Code]='DEF'

Joins Queries
Join queries to report on employee participation in the Deferred Compensation plan.
1. From the side panel, select the Queries icon, and then select Queries.

960CLP031419 18 of 58
2. From the side panel, select the Toolbox icon, and then drag a Join object to the work area.

3. Right-click the Query object, and then from the drop-down list select Rename Query.
4. In the Value field, enter a name, and then select OK.
5. Drag the Employee Query object and drop it in the top drop zone.
6. Drag the Deduction/Benefit Query object and drop it in the bottom drop zone.

7. On the Queries page, double-click the Join icon.


a. In the Join Relationships dialog box, select New Link.
b. From the Employee Query pane, select Employee Number.

960CLP031419 19 of 58
c. From the Deduction/Benefit Query pane, select Employee Number.
d. In the Join Relationships dialog box select, New Link again.
e. From the Employee Query pane, select Company Code.
f. From the Deduction/Benefit Query pane, select Company Code.
8. Select OK to accept the default cardinality.

Note
Accepting the default cardinality returns all matching rows.

9. Double-click the EE Deduction/Benefit Query.


10. From the side panel, select the Data icon.
a. From the Employee Query, drag data items to the Data Items pane.
• Company Code
• Employee Name (Last Suffix, First MI)
• Employee Number
• Employment Status Code
b. From the Deduction/Benefit Query, drag data items to the Data Items pane.
• Deduction/Benefit Type Code

Note
Only one Employee Number data item and one Company Code data item are required to be added
to the Data Items pane.

Add Data to a Report Layout


Add query data items to a report layout to view output.
1. From the side panel, select the Pages icon, and then select Page1.
2. In the report layout area, select the + icon and then select List.
3. From the Query Name drop-down list in the Object and Query Name dialog box, make a
selection, and then select OK.

960CLP031419 20 of 58
• EE Deduction/Benefit Query
4. From the side panel, select the Data icon, and then select Data Items tab.
5. From the EE Deduction/Benefit Query, add data items to the list container.

• Employee Name (Last Suffix, First MI)


• Employee Number
• Deduction/Benefit Type Code

Note
Add only those data items to the report layout that you want to view in the output.

6. From the side panel, select the Toolbox icon, expand the Textual section.
7. Add a Row Number object to the left of the list container.

Create a Left Outer Join


Use a Left Outer Join to display employees who do participate in the Deferred Compensation plan as
well as those employees who do not participate.

1. From the side panel, select the Queries icon, and then select Queries.
2. On the queries page, double-click the Join icon.
a. In the Join Relationships dialog box select New Link.
b. From the Employee Query pane, select Employee Number.
c. From the Deduction/Benefit Query pane, select Employee Number.
d. In the Join Relationships dialog box select New Link again.

960CLP031419 21 of 58
e. From the Employee Query pane, select Company Code.
f. From the Deduction/Benefit Query pane, select Company Code.
3. From the left Cardinality drop-down list select 1..1.
4. From the right Cardinality drop-down list select 0..n.

5. Select OK.
6. Run the report in HTML format, review the report output, and then close the report viewer.

Note
Apply a filter to view employees who do not participate.

7. From the Queries page, double-click the EE Deduction/Benefit Query, and then from the Data
Items pane, drag the Deduction/Benefit Type Code data item to the Detail Filters pane.
8. Complete the expression, validate the expression, and then close the report viewer.

• [Deduction/Benefit Type Code] is missing

9. Select OK again.
10. Run the report in HTML format, review the report output, and then close the report viewer.

960CLP031419 22 of 58
The filter enables us to view employee names without a match in the Deduction/Benefit Query.

11. From the Detail Filters pane, select the filter expression and then press the Delete key.

Note
To disable the filter so that it can be re-used later, navigate to the report page, and select the list
container. From the on-demand toolbar select the Filter icon and then Edit Filters. Select the
filter expression and then select the Disabled radio button.

960CLP031419 23 of 58
Create a Right Outer Join
Use a Right Outer Join to display the names of all active employees for the selected company that do
participate in the Deferred Compensation plan as well as the selected Deduction/Benefit Type Code not
assigned to any employee name.

Note
Left and Right Outer Joins are functionally equivalent. If the query positions are reversed, output from
a Right Outer Join is identical to that of a Left Outer Join.

1. From the side panel, select the Queries icon, and then select Queries.
2. On the queries page, double-click the Join icon.
3. From the left Cardinality drop-down list select 0..n.
4. From the right Cardinality drop-down list select 1..1.

5. Select OK.
6. Run the report in HTML format, review the report output, and then close the report viewer.

960CLP031419 24 of 58
Create a Full Outer Join
Use a Full Outer Join to view all data items (matched and non-matched) from both queries.

Avoid using a Full Outer Join when possible because it can result in significant performance issues.
This exercise is included to illustrate the results in a limited database.
1. From the side panel, select the Queries icon, and then select Queries.
2. On the queries page, double-click the Join icon.
3. From the left Cardinality drop-down list select 0..n.
4. From the right Cardinality drop-down list select 0..n.

5. Select OK.
6. Run the report in HTML format, review the report output, and then close the report viewer.

960CLP031419 25 of 58
UltiPro® is a registered trademark of The Ultimate Software Group, Inc.
All other company and product names referenced herein are the trademarks or registered trademarks of their respective
holders. No part of this document may be reproduced in any form or by any means or stored in a database or retrieval
system without the prior written authorization of The Ultimate Software Group, Inc. Information in this document is subject
to change without notice. All company, organization, person, and event references are fictional. Any resemblance to actual
companies, organizations, persons, and events is entirely coincidental. Nothing herein constitutes legal advice, tax advice,
or any other advice.

960CLP031419 26 of 58
ACTIVITY
Explore Cardinality

ACTIVITY SCENARIO
Determine how many job codes are not currently assigned to
any of your employees
• Create a list report using the Administrator Package
• Use the handout Explore Cardinality in Cognos Analytics
Demonstration as a reference

960CLP031419 27 of 58
ACTIVITY SCENARIO
1. Create two queries.
• Query 1: Job Code Query
• Query 2: Employee Query

2. Add the following data item to the Job Code Query.

ACTIVITY SCENARIO
3. Add the following data items to the Employee Query.

4. Join the queries through the Job Code data item and set
cardinality for a Left Outer Join.
• Cardinality: [1..1] = [0..n]

960CLP031419 28 of 58
ACTIVITY SCENARIO
5. Name the Join query, Combined Query, and then add data
items to the Combined Query.

6. Add the data items from the Combined Query to a list on the
report page in the following order.
• Employee Name (Last Suffix, First MI)
• Employee Number
• Job Code

ACTIVITY SCENARIO
7. Add a Row Number object from the Toolbox to the leftmost
report column.
8. Run the report.
a. How many Job Codes are not assigned to an employee?
b. How would you retrieve only a listing of the Job Codes not
assigned to an employee (no employee names)?
9. Set the cardinality to an Inner Join.
• Cardinality: [1..1] = [1..1]
10. Run the report again. How many employees are listed?
• Scroll through the report to confirm that all Job Codes match an
employee name. (Hint: Use the Properties Pane to set the
number of Rows per Page to 200.)

960CLP031419 29 of 58
ACTIVITY SCENARIO
11. Name the report Explore Cardinality Activity, and save it in
the My Content folder.

12. Answer the following questions about best practices for


creating Joins.
a. When creating a Join, which query is the main query?
b. Which cardinalities should be avoided when creating Joins?
c. If employee data is in the left query, which cardinalities will
force retrieval of only one transaction per employee?

ACTIVITY SOLUTION
8.a. How many Job Codes are not assigned to employees?
• 16

960CLP031419 30 of 58
ACTIVITY SOLUTION
8.b. How could you retrieve a listing of only the Job Codes not
assigned to an employee (no employee names)?
• Filter for missing employee names:
([Employee Name (Last Suffix, First MI] is missing)
• You could also filter for missing Employee Number

Employees Job Codes

10. How many employees are listed when using an Inner Join?
• 113

ACTIVITY SOLUTION
12. a. When joining queries, which query is the main query?
• Left-side query
12.b. Which cardinalities should be avoided when creating
Joins?
• [0..n] = [0..n]
• [0..1] = [0..1]
• [1..n] = [1..n]
12.c. If employee data is in the left query, which cardinalities
force retrieval of only one transaction per employee?
• [1..1] = [1..n]
• [1..1] = [0..n]
• [1..1] = [0..1]

960CLP031419 31 of 58
KEY CONCEPTS
• A Join combines the records from two UltiPro tables using
common values
• Cognos Analytics Reporting queries pull data from the UltiPro
tables for reporting purposes
• Joins are useful for creating relationships between queries
that may not exist in the model

KEY CONCEPTS
• Delivered packages are modeled with joins to meet most
reporting requirements
• Create joins only when existing joins do not meet your needs
for a particular report
• Data not joined in the model
• A different view of your data is required
• Determine what you want to view in your report
• Determine which query will be the main query (left side)

960CLP031419 32 of 58
KEY CONCEPTS
• Use these cardinalities to retrieve ONE transaction per data
item of interest:
• [1..1] = [1..n]
• [1..1] = [0..n]
• [1..1] = [0..1]
• Avoid using these cardinalities due to unpredictable results
and long run time:
• [0..n] = [0..n]
• [0..1] = [0..1]
• [1..n] = [1..n]
Important! Incorrectly configured cardinality can increase report run time
from minutes to hours, and return incorrect or unexpected results

Resolve Cross-Join
LESSON 2 Errors

960CLP031419 33 of 58
LESSON OBJECTIVES
• Resolve a cross-join error

Cross-Join Error
• If you attempt to run a report that pulls query items from
different tables that have not been joined in the model, a
cross join error message appears

960CLP031419 34 of 58
DEMONSTRATION
Resolve a Cross-Join Error
Scenario: Create a report that
lists employees who have
accessed the organization’s
computer fields. The report must
include employee job codes.

ACTIVITY
Resolve a Cross-Join Error

Job Aid: Join Queries in Cognos Analytics


Reporting

960CLP031419 35 of 58
ACTIVITY SCENARIO
• Create a report that identifies employees who have
accessed the organization’s HIPAA records
• Create a list report using the Administrator Package
• Add employee job codes to the report
• Use the Join Queries in Cognos Analytics Reporting job aid

ACTIVITY SCENARIO
1. Create a list report with the following data items from the
Administrator Package.

2. Run the report in HTML format, view the report output, and then
close the report viewer.

960CLP031419 36 of 58
ACTIVITY SCENARIO
3. Add a data item from another folder to the right of the list
report.

4. Run the report. What is the result?


5. Delete the Job Code column from the report layout.
6. Add a second query to the report.
7. Rename the queries.
• Change "Query1" to "Main Query"
• Change "Query2" to "Job Query"

ACTIVITY SCENARIO
8. From the Source pane, add the following data items to the
Job Query.

9. Create a Join query. Rename the query, HIPAA Audit Query.


10. Link the Employee Number data items and the Company
Code data items.
11. Set cardinality for both queries to [1..1]=[1..1].

960CLP031419 37 of 58
ACTIVITY SCENARIO
12. Add all data items from the Main Query and the Job Query
to the HIPAA Audit Query.
• Add Employee Number and Company Code only one time.
13. Navigate to the report page, and link the List to the HIPAA
Audit Query.
• Hint: Select the List object, and then from the application bar,
select the Show Properties icon. Then, select the Join query from
the Query drop-down list in the Data section.
14. From the Source pane, add the Job Code data item from
the HIPAA Audit Query to the right column of the report.

ACTIVITY SCENARIO
15. Run the report in HTML format, view the report output, and
then close the report viewer.
16. Name the report, Cross-Join Error Activity, and save it to the
My Content folder.

960CLP031419 38 of 58
Join Queries in Cognos Analytics Reporting
Business Intelligence

Cross-Join Error
A join is a relationship between a field in one query and a field of the same data type in another query.
If a Cognos Analytics report includes data items from different Administrator Package folders, for
example, and those data items are not joined in the model, a cross-join error results.

To report on UltiPro data in different tables you must:


• Create multiple queries.
• Join the queries through a common data item.
• Link the join query to the report page.

Join Relationship - Administrator Package Example


This example demonstrates how to report on data items from two Administrator Package folders: Audit
Information folder and Employee Information folder.

Important
The Administrator Package is intended for use only by experienced Business Intelligence users with a
knowledge of data modeling.

Create Multiple Queries


Begin by creating separate queries on the Queries page in Cognos Analytics Reporting.
1. Open Cognos Analytics, and then create a report using the Administrator Package.

960CLP031419 39 of 58
2. From the side panel, select the Queries icon, and then select the Add Query icon (+).

3. Right-click Query1, and then from the drop-down list select Rename Query.
4. Rename the query, and then select OK.
In this example, the query is renamed Employee Query.
5. Double-click the new query, and then add data items to the query.
a. From the side panel, select the Data icon, and then expand the package data items in the
Source pane.

b. Navigate to the Audit Information folder, and then add data items to the Data Items pane.

6. From the side panel, select the Queries icon, and then select the Add Query icon (+).
7. Right-click Query1, and then from the drop-down list select Rename Query.

960CLP031419 40 of 58
8. Rename the query, and then select OK.
In this example, the query is renamed Job Code Query.
9. Double-click the new query, and then add data items to the query.
a. From the side panel, select the Data icon.
b. Navigate to the Employee Information folder, and then add data items to the Data Items
pane.

Next, join the queries by linking a common data item.

Join Queries
Combine data from different UltiPro tables by joining separate queries through a common data item.
1. From the side panel, select the Queries icon, and then select Queries.

2. From the side panel, select the Toolbox icon, and then drag a Join object to the work area.
3. Right-click Query1, and then from the drop-down list select Rename Query.
4. Rename the query, and then select OK.
In this example, the Join query is renamed Employee Audit Query.

960CLP031419 41 of 58
Two drop zones appear to the right of the Join object.
5. Drag the first query icon to one drop zone, and drag the second query icon to the other drop zone.

6. Double-click the Join object.

The Join Relationships dialog box appears.


7. Select the New Link button.
8. From each query pane, select a matching data item.
In this example, the Employee Number data item is linked.
9. From the Cardinality drop-down lists, select cardinalities that will produce the desired report
output.

960CLP031419 42 of 58
Note
Cardinality defines the relationship between queries: one-to-one, one-to-many, many-to-one,
many-to-many. Cardinality can be changed as needed.

10. Select OK.


11. Double-click the Join query icon.
12. From the side panel, select the Data icon and then select the Data Items tab.

13. Drag query items from the first and second queries to the Data Items pane.

960CLP031419 43 of 58
Note
In this example only one Employee Number data item is required in the Join query.

Associate a Query with a Report Container


For data items in a query to appear on a report page, the query must be linked to a container on the
report layout.
1. From the side panel, select the Pages icon, and then select Page1.

2. In the report work area, select the + icon, and then select a List report layout.

3. From the Object and Query Name dialog box, select the Query Name drop-down list.
4. From the drop-down list, select the Join query, and then select OK.

960CLP031419 44 of 58
To associate an existing List to the Join query, on the report layout select the List (three orange
dots in the upper left corner), and then from the application bar, select the Show Properties icon.
From the Data section, select the name of the Join query from the Query drop-down list.
The Join query is now associated with the report container.
5. From the side panel, select the Data icon, and then the Data Items tab.
6. Move data items from the join query to the report container.

7. Format and filter the report as needed.


8. Save, and then run the report.

UltiPro® is a registered trademark of The Ultimate Software Group, Inc.


All other company and product names referenced herein are the trademarks or registered trademarks of their respective
holders. No part of this document may be reproduced in any form or by any means or stored in a database or retrieval
system without the prior written authorization of The Ultimate Software Group, Inc. Information in this document is subject
to change without notice. All company, organization, person, and event references are fictional. Any resemblance to actual
companies, organizations, persons, and events is entirely coincidental. Nothing herein constitutes legal advice, tax advice,
or any other advice.

960CLP031419 45 of 58
ACTIVITY SOLUTION
2. Create a list report from the Audit Information folder.

4. Add Job Code from the Employee Information folder and


run the report.
What is the result?

ACTIVITY SOLUTION
• Join the queries

• Link the queries and


assign a cardinality

960CLP031419 46 of 58
ACTIVITY SOLUTION
15. Add data items from the combined query to the report
layout and run the report.

KEY CONCEPTS
• Data items in the Administrator Package are organized in a
folder structure
• Reports populated with data items that reside in different folders might
result in a cross-join error
• If you attempt to run a report that pulls query items from
different tables that have not been joined in the model, a
cross-join error message appears

960CLP031419 47 of 58
Merge Queries to Create
LESSON 3
Adjacent Columns

LESSON OBJECTIVES
• Join queries to merge data into a single list report in order to
apply calculations

960CLP031419 48 of 58
Adjacent Columns
• Joins can be used to align columns next to each other

Join Object vs Union Object


• Join merges two queries
• Union combines data from two or more queries
• Must have same number of columns and the same data type
• Data from both queries display in a single column differentiated by row

960CLP031419 49 of 58
DEMONSTRATION
Merge Queries to Create
Adjacent Columns
Scenario: Create a list report to
view headcount and salary
growth over a ten-year period.

ACTIVITY
Merge Queries to Create
Adjacent Columns

Job Aid: Join Queries in Cognos Analytics Reporting


Job Aid: Add Calculations to a Cognos Analytics
Report

960CLP031419 50 of 58
ACTIVITY SCENARIO
• Create a list report to view headcount growth over a ten-
year period
• Your report should include one list with columns for headcount
in 2007 and 2017
• Calculate the percentage change from 2007 to 2017
• Use the following job aids:
• Join Queries in Cognos Analytics Reporting
• Add Calculations to a Cognos Analytics Report

ACTIVITY SCENARIO
1. Begin with the 960 – Headcount Report XML file.
a. Select the report link on the UltiPro home page.
b. At the bottom of the page, select the report name. The report XML
appears in Notepad.
c. Right-click the Notepad window, and then from the drop-down list
select the Select All option.
d. Right-click the Notepad window, and then from the drop-down list
select Copy.
e. Navigate to Cognos Analytics and open Reporting.
f. From the Templates and Themes page, select the Blank template,
and then select OK.
g. From the side panel, select the Pages icon, and then right-click
Report.

960CLP031419 51 of 58
ACTIVITY SCENARIO
1. (Continued) Begin with the 960 – Headcount Report XML
file.
h. From the drop-down menu select Open Report from Clipboard.
i. Paste the report XML in the Open Report from Clipboard dialog box
(right-click and then select Paste), and then select OK.
j. Run the report in HTML format, review the report output, and then
close the report viewer.

ACTIVITY SCENARIO
2. On the queries page, add a Join object.
• Query Name: Headcount – Combined
3. Join the original queries through the common data item, Org
Level 1 Code, and set the cardinality.
• Cardinality: [1..1] = [1..1]
4. Add all data items from the 2007 Headcount by Region
Query and the 2017 Headcount by Region Query to the
Headcount - Combined Query (add Org Level 1 Code only
one time).
5. On the report layout, add a List object to the bottom block
and link it to the Headcount - Combined query.

960CLP031419 52 of 58
ACTIVITY SCENARIO
6. Add data items from the Headcount - Combined query to
the new list on the report layout.
• Org Level 1 Code
• 2007 Headcount
• 2017 Headcount
7. Add a Query Calculation object to the right side of the report
list. Create an expression that calculates the growth rate.
• Name the column Headcount Growth
• Expression Definition: ([2017 Headcount]-[2007 Headcount]) /
[2007 Headcount]

ACTIVITY SCENARIO
8. Format the data as a percent with no decimal places.
9. Remove the two original list containers from the report
layout.
10. Run the report in HTML format, view the report output, and
then close the report viewer.
11. Save the report to the My Content folder.
• Name: Headcount Report

960CLP031419 53 of 58
Add Calculations to a Cognos Analytics Report

Calculations
A calculation is an expression created in Reporting that extends your UltiPro data beyond what is
stored in the database. Calculations can be based on numeric or non-numeric data.
An expression is any combination of operators, constants, functions, or other components that evaluate
to a single value.
Calculation results are not stored in the underlying data source. Instead, Reporting re-runs the
calculation each time the report runs. The results are always based on the most current data in the data
source.

Create a Calculation Based on Numeric Data


Calculations can be created to extend your use of numeric data items.
You can create a calculation using the Query Calculation object in the Toolbox, and then adding an
expression.
You can also select a measure data item in the report layout, and then select the Insert Calculation icon
from the on-demand toolbar. Cognos Analytics Reporting suggests calculations that relevant to the data
item.
1. From the side panel, select the Toolbox icon.
2. Expand the Textual divider, and then drag the Query Calculation object to the right of a column
in the report layout.
3. In the Name field, enter a name for the new column heading.
4. From the Available Components pane, select the Data Items tab.
5. Move the data item on which the calculation is based to the Expression Definition pane.
6. In the Expression Definition pane, complete the expression.
7. Validate the expression, and then select OK.
8. Run the report in HTML format, view the report output, and then close the report viewer.
9. Name and save the report.

960CLP031419 54 of 58
Format Report Data
Format data to make a report easier to read.
1. From the report, select a column and then from the on-demand toolbar select Data Format.
2. In the Data Format dialog box, make formatting selections, and then select OK.

Create a Calculation Based on a Text Expression


Calculations can be created to extend your use of text expressions.

1. From the side panel, select the Toolbox.


2. Expand the Textual divider, and then drag the Query Calculation object to the right of a column
in the report layout.
3. In the Name field, enter a name for the new column heading.
4. In the Expression Definition pane, make an entry.
Ensure that single quotations marks appear around text entries.
5. Add functions to the Expression Definition pane, as needed.
When you select a function in the Available Components pane, syntax information appears in the
Information pane.
6. From the Source tab in the Data Item Expression dialog box, add the data items, as needed.
7. Complete the expression.
8. Validate the expression, and then select OK.
9. Run the report in HTML format, view the report output, and then close the report viewer.
10. Name and save the report.

String Functions
Several string functions return a portion of a character string.
If [SSN] = 123-45-6789
Note that in a data item formatted with hyphens, the hyphens are counted as characters.

Function Description Example


Left Returns 3 characters starting from the left. Left([SSN],3)= 123
Right Returns 4 characters starting from the right. Right([SSN],4)=6789
Substring Returns 2 characters starting at position 5. Substring([SSN],5,2)=45

960CLP031419 55 of 58
UltiPro® is a registered trademark of The Ultimate Software Group, Inc.
All other company and product names referenced herein are the trademarks or registered trademarks of their respective
holders. No part of this document may be reproduced in any form or by any means or stored in a database or retrieval
system without the prior written authorization of The Ultimate Software Group, Inc. Information in this document is subject
to change without notice. All company, organization, person, and event references are fictional. Any resemblance to actual
companies, organizations, persons, and events is entirely coincidental. Nothing herein constitutes legal advice, tax advice,
or any other advice.

960CLP031419 56 of 58
ACTIVITY SOLUTION
1. Run the 960 – Headcount Report

3. Join the queries

ACTIVITY SOLUTION
7. Create an expression to display headcount growth

10. Run the report: Headcount Report displays percentage


change

960CLP031419 57 of 58
KEY CONCEPTS
• Joins can be used to align columns next to each other. Useful
when applying calculations
• Union is the complement of a Join
• A Join merges query results to create more columns
• A Union combines data into additional rows, but with the same number
of columns
• Union combines data from two or more queries that have the
same number of columns and the same data type

Congratulations!
You have completed the
960 Cognos Analytics: Create Joins course!

960CLP031419 58 of 58

You might also like