0% found this document useful (0 votes)
16 views38 pages

HCM 2021 Query Builder Getting Started Guide

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views38 pages

HCM 2021 Query Builder Getting Started Guide

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Epicor® HCM 2021

Query Builder Getting Started Guide


Epicor® HCM 2021

Query Builder Getting Started Guide

Epicor Software Corporation


Notices
This manual is furnished under a license agreement with Epicor® Software Corporation. The
manual was prepared to assist operators of Epicor Software Corporation’s Epicor HCM
product and may not be used for any other purpose without Epicor’s written permission. The
material contained herein is supplied without representation or warranty of any kind, is sub-
ject to change without notice, and does not represent a commitment by Epicor. Companies,
names, and/or data used in screens and sample output are fictitious unless otherwise noted.
Epicor assumes no responsibility and shall have no liability of any kind from the supply or
use of this manual or the material it contains. In an Epicor HCM-hosted or subscription envir-
onment, some Epicor HCM software functionality may not be available.
U.S. Government Restricted Rights. This software and its documentation are "Commercial
Items," as that term is defined at 48 C.F.R. §2.101, consisting of "Commercial Computer Soft-
ware" and "Commercial Computer Software Documentation," as such terms are used in 48
C.F.R. §12.212 or 48 C.F.R. §227.7202, as applicable. Consistent with 48 C.F.R. §12.212 or 48
C.F.R. §§227.7202-1 through 227.7202-4, as applicable, the Commercial Computer Software
and Commercial Computer Software Documentation are being licensed to U.S. Government
end users (a) only as Commercial Items and (b) with only those rights as are granted to all
other end users pursuant to the terms and conditions herein. Unpublished rights are
reserved under the copyright laws of the United States.
Manufacturer is Epicor Software Corporation.
804 Las Cimas Parkway
Austin, TX 78746
www.epicor.com
Epicor HCM is a registered trademark of Epicor Software Corporation.
Windows Server 2012, Windows 10,and Windows 7 are registered trademarks of Microsoft
Corporation. SQL Server is a trademark of Microsoft Corporation.
All other trademarks are the property of their respective owners.
Copyright © 2021, Epicor Software Corporation. All rights reserved.
Printed in the U.S.A.
July 2021
Contacting Epicor Software Corporation
General Information
Epicor provides a variety of human resource software products and support services. You can
contact us at Epicor or find out more information about additional software products or ser-
vices using any of the following methods:
Epicor Software Corporation
804 Las Cimas Parkway
Austin, TX 78746
(800) 678-5266 (General Information)
www.epicor.com

Epicor HCM Product Support and Education Services


Epicor HCM users with a current maintenance agreement have access to telephone hotline
support. When you call the Product Support and Education (PSE) hotline, a qualified PSE rep-
resentative works with you to diagnose and correct your problem. Contact a Epicor HCM PSE
representative using the following methods:

Telephone: (800) 424-6749


E-mail: [email protected]

Please have the following information at hand before you contact a PSE representative:
l Your customer number.
l A listing of any Epicor HCM modules or service packs that you have installed.
l A clear summary of the problem. Identify it specifically, especially in doc-
umentation that your organization can use later. Write down each step you
took when you found the problem (take screen prints, if possible).
l Any specific error messages you encountered.
Table of Contents
About This Guide vii

Who Should Read This Guide viii


Where to Look for More Information ix
Epicor HCM Online Help ix
Field Level Help ix
Microsoft Windows Online Help ix
Internet Explorer Online Help ix
Conventions Used in This Guide x
Introduction To Query Builder 1

Overview of Query Builder 2


Query Builder 3
Types of Queries 3
Designer Tab 4
Add Fields 4
Add and Remove Tables 5
Manage Table Joins 6
Add Criteria 8
Query Tab 9
Results Tab 10
My Query Component 11
Use Query Builder 12
Create a New Person Query 12
Add Tables and Fields to a Query 13
Add Criteria 13
Manage Field Properties 14
Manage Joins 14
Save your Query 14
Real-World Examples 17

Employees and Current Location 18


Employee and Dependent 20
Name, Title, Pay, and Department 22
Add a Field to a Superview 24
About This Guide

This guide helps you understand the basic building blocks and concepts
behind the Epicor HCM Query Builder.

Concepts covered in this preface include:

Who Should Read This Guide viii


Where to Look for More Information ix
Conventions Used in This Guide x

- vii -
Preface

Who Should Read This Guide


This guide is for those HR Report Writers using the Epicor HCM Query Builder.
Please read this guide to become familiar with basic concepts and to under-
stand how Query Builder interacts with your Epicor HCM database.

- viii -
About This Guide

Where to Look for More Information


There are several online help systems where you can find information and
documentation relating to Epicor HCM. This section describes the different
online sources available to assist you in using Epicor HCM and related soft-
ware.

Epicor HCM Online Help

Epicor HCM has an extensive online help facility to assist you when you need
help. You can access online help in Epicor HCM by clicking the Help button
that is in the product. If you are in a task when invoking help, the help topic
for the task that you are viewing appears.
Each procedural help topic in the Epicor HCM online help provides systematic
instructions that guide a user through completing a task. Once the online
help is open, you can navigate to other areas in the help system. You can
search for other procedures through the Contents, Index or by using the
built-in Search functionality.

Field Level Help

While Epicor HCM is very intuitive to use, there may be certain fields in a task
that are more difficult to work with or remember their purpose. Epicor HCM
has a Field Level Help system, where some key fields have been singled out
for quick access to information. Anywhere you see a question mark icon
you can click it to display an informational box. The information presented is
intended to assist you in completing that field and therefore to finish the
task. If you need further assistance, the full online help system is always avail-
able.

Microsoft Windows Online Help

For more information about Microsoft Windows, choose Help and Support
from the Start menu.

Internet Explorer Online Help

Use Microsoft Internet Explorer Help for assistance with issues specific to
Internet Explorer. To view Microsoft Internet Explorer Help, from the Menu
bar click Help > Internet Explorer Help or press F1 on your keyboard.

- ix -
Preface

Conventions Used in This Guide


As you use this guide, you'll notice that some text appears in bold or italic let-
tering. These conventions have meaning and help you learn and use Epicor
HCM. You'll see the following conventions in this guide.
Convention Description
bold Used for box labels including check boxes, drop-down list items, menu
names, menu labels, and any literal text that you must type exactly as
presented. Especially important to use for boxes where the label has mul-
tiple words or is a sentence. Also may be used for dialog box titles.
italic Any variable text you replace with specific text, such as the current date
or the name of a file, appears in italics.
Navigational When you’re instructed to select an item, this instruction typically means
Terminology to click the item to highlight it (as in a list). When you’re instructed to
choose or click an item, these actions execute a command (as when
choosing or clicking the OK button). Double-click means to quickly press
and release the left mouse button twice. Press refers only to keys on the
keyboard. Enter means to type the text as indicated and take the appro-
priate action to move on to the next step. For example, “Enter the
employee’s hire date” means to type the date in the box and then to press
the TAB key to move to the next box.

-x-
Chapter 1

Introduction To Query Builder

This chapter is dedicated to introducing Query Builder and explaining how


your organization can successfully apply this functionality.

Concepts covered in this chapter include:

Overview of Query Builder 2


Query Builder 3
My Query Component 11
Use Query Builder 12

Epicor HCM | 1
Chapter: 1

Overview of Query Builder


Epicor HCM Query Builder is a reporting tool that allows you to create custom
database queries to analyze and evaluate your HR data. You can use this tool
to pull raw data or as the source for presentation-style reports to use in
Report Builder. The Query Builder tool is simple enough that anyone with the
right permissions can create custom queries in Epicor HCM.
In short, Query Builder can benefit your company by:
n Allowing you to easily create custom queries that do not require
intimate knowledge of your database.
n Helping you to create data sources that cannot be created against
the Reporting Services model delivered with Epicor HCM.
n Giving you an interface that simplifies the process, which means no
technical expertise is required to query your data in meaningful, truly
customized ways.

2 | Epicor Software Corporation


Introduction To Query Builder

Query Builder
Query Builder provides access to the Epicor HCM database from the user
interface.

NOTE: Out-of-the-box, the Query Builder is available to users in


the Admin role. You can open this availability to other roles as you
see fit.

Types of Queries
Part of the power of Epicor HCM is that it puts you in complete control of
your human resources data. The Query Builder tool enhances that control by
giving you the ability to create customized snapshots of your HR data.
The Query Builder allows you to easily create these queries. No technical
expertise is necessary to create powerful queries that give you deep insight
to your HR data.
Find the Query Builder on the Reports menu, and then navigate to Ad Hoc
Query Builder.
Query Builder opens in a new browser window. To start a new report, from
the File menu, select New, and then select one of the following query types.
Query Type Description
Person Query Person queries are the most common query option. They cre-
ate a query that starts with the tPerson table and returns data
about the people in your Epicor HCM database. For example,
use a person query to create a query listing employees’ cur-
rent job title, department and annual salary.
To ensure row security, a person query always includes the
PersonGUID field; this field must be a part of your query.
Table Query Use a table query to build a query that begins with a table
other than the tPerson table. For example, you could use this
menu item to build a that lists benefit plan data or requisition
data. When designing a query from a non-person table, you
have access to superviews and previously created queries
saved as views for use in your query. You cannot, however,
use a tPerson table.
SQL Query Use a SQL query to create a query from scratch, manually
entering SQL code. This query type is for advanced users who
have an intimate understanding of SQL and the Epicor HCM
database. This option is available only to people assigned to
the Query Builder administrator role.
Row Security Query Use a row security query to select a specific set of people to
whom you want a security group to have access, and then use

Epicor HCM | 3
Chapter: 1

Query Type Description


the query as a new security rule.
Rules you create here are available in real time: once saved in
Query Builder, new row security rules are available for use in
the Epicor HCM application. This query type is for advanced
users who have intimate understanding of row security, and is
available only to people assigned to the Query Builder admin-
istrator role.
Copy From Existing Use the Copy from Existing Query option when using an exist-
Query ing query as the basis of a similar query. For example, you
might do a side-by-side comparison of What-if scenarios,
based on data similar to that of an existing query, but with
tweaks to your assumptions. Rather than creating a new
query for each scenario, you could create the query just once,
then copy and modify it accordingly multiple times to suit your
needs.

Once you select the type of query to create, you are prompted to enter addi-
tional information about the query, including the name of the query and a
description. You are also prompted to select query options, such as filtering
to current history records, filtering to active employees only, and sharing the
query. If your Epicor HCM system is licensed for the Position Control module,
you can also opt to have the system automatically select the employees'
primary position.
You can change these query properties at any time from the File menu by
selecting Properties. Upon entering query information, the Query Builder
opens the Designer tab.
Before creating a query, become familiar with the following areas of the
Query Builder.

Designer Tab
The Designer tab is a graphical user interface, allowing you to design quer-
ies.Use the Designer tab to add fields to a query, include tables in the query,
manage table joins, and add criteria to a query.

Add Fields

To add a field from a table to your query, select the check box next to the
field you want to add. The fields that you add to the query display on the
Fields tab at the bottom of the form. Use the Fields tab to change field
information:

4 | Epicor Software Corporation


Introduction To Query Builder

n Use the Alias field to change the display name for the field. The alias
you enter displays as the column header on the Results tab.

For example, you might want to change the display name of Full
Name to Employee Name to describe the data that is returned.
n Use the Sort Order field to change how the query sorts the results:
Ascending, Descending, or None.
n Use the Filtered field to apply on-the-fly criteria on the Results tab. If
you select true in the filtering for a field, when you open the Results
tab, a Filters selection displays at the top of the results, allowing you
to define that data that is returned.
Using filtering means that you do not need to create and change cri-
teria each time you return the results of a query.
n Use the Visible field to display or hide a column (or columns) on the
Results tab. Select True to display the column on the Results tab;
select False to hide it.
n Click to insert a new, blank line on the bottom of the
Fields grid. Use this open line to enter a custom formula to create
non-standard displays of data. The syntax of your formula must
match a built-in SQL function.
For example, you may want to display first initials and last names.
The Epicor HCM standard is first name and last name. Add a field as a
formula that concatenates the first letter of the value in the
FirstName column with the value in the LastName column.
The formula you enter must also include the name of the table from
where the data is pulled. Using the example above, the formula to
return the first letter of the first name is
SUBSTRING(tPerson.FirstName, 1, 1), where ‘SUBSTRING” is the
SQL function, ‘tPerson.FirstName’ is the table and column in the data-
base, and ‘1, 1’ tells the formula to start with the first letter and dis-
play one character (similarly, ‘1, 3’ would start with the first letter and
display three characters).

Add and Remove Tables

To add a new table to the query, click the Plus Sign (+) located in the upper-
right corner of the table. The Related Tables form opens in a new window
and lists all tables associated with your root table. Use the Search field to
quickly find a table to add to your query.

Epicor HCM | 5
Chapter: 1

Once you have located the table to add, click the next to the table name
and linking field to add the table to your query.
When adding tables to a query using the Related Tables form, remember:
n The Related Tables for only lists tables and views related to the par-
ent.
n Tables may appear more than once, as some tables are joined to the
parent table on multiple fields. For example, the Person Location His-
tory table is joined to the Person table twice: once on the PersonGUID
field for the employee and on the PersonGUID field for the
employee’s supervisor.
n When searching for a table to join, the results display any table where
there’s a match, including table names and column names.

You can also add tables to your query by locating the linking field in the base
table and clicking . This adds the table directly related to the linking field.
After building your query on the Designer tab, Query Builder administrators
can use the Query tab to work directly with the SQL on the Query tab. All
users can view the output on the Results tab.

Manage Table Joins

Joins determine how the query relates data between two tables. There are
times when you will need to alter the joins in order to get the data you are
searching for in your query. There are three types of joins available for use
with Query Builder:
n INNER Joins: INNER joins retrieve only those records from one table
that have a matching record in the joined table. When one or more
table is added to a query, Query Builder automatically connects the
tables using an INNER join.
n LEFT OUTER Joins: LEFT OUTER joins retrieve all of the records from
the table listed in the left column regardless of whether or not they
have a record in the table in the right column.
n RIGHT OUTER Joins: RIGHT OUTER joins retrieve all of the records
from the table listed in the right column regardless of whether or not
they have a record in the table in the left column.

The following examples illustrate how the different join types return data:

6 | Epicor Software Corporation


Introduction To Query Builder

The two tables join on the PersonGUID field and, by default, join using an
INNER join. As such, to be included in the results of the query, the Per-
sonGUID must be in both tables. The results of this join are:
tPerson Per- tPerson tPerson tPersonCertification tPersonCertification tPersonCertification
sonGUID Firstame LastName PersonGUID Certification Code Achieved Date
1234567 Joe Smith 1234567 APLUS 11/15/2009
4567890 Linda Johnson 4567890 MSCD 4/2/2011

Changing the INNER join to a LEFT OUTER joins returns all of the records
from the table on the left (tPerson) regardless of whether a corresponding
record exists in the table on the right. Using the same example tables above,
the results of the LEFT OUTER join are:
tPerson Per- tPerson tPerson tPersonCertification tPersonCertification tPersonCertification
sonGUID Firstame LastName PersonGUID Certification Code Achieved Date
1234567 Joe Smith 1234567 APLUS 11/15/2009
2345678 Susan Jones
3456789 John Davis
4567890 Linda Johnson 4567890 MSCD 4/2/2011

A RIGHT OUTER join is the opposite of a LEFT OUTER join. All of the data from
the table on the right is returned regardless of whether data exists in the
table on the left. The results of the RIGHT OUTER join are:
tPerson Per- tPerson tPerson tPersonCertification tPersonCertification tPersonCertification
sonGUID Firstame LastName PersonGUID Certification Code Achieved Date
1234567 Joe Smith 1234567 APLUS 11/15/2009
4567890 Linda Johnson 4567890 MSCD 4/2/2011
5678901 WORD 8/15/2013

Use OUTER joins when you know people in your Epicor HCM database will
not have a record in one of the tables, but you still want them to be listed in
the results. For example, if you want a list of all active employees and their
dependents regardless of whether or not they have dependents, use an
OUTER join. The OUTER join works in this case because every employee has a
record in the tPerson table, however, not every employee has dependents.

Epicor HCM | 7
Chapter: 1

When using OUTER joins in a query, if there is a table on the subordinate end
of an OUTER join, the second join must also be an OUTER join. OUTER joins,
once started, must be use to the terminus of the join connections.

Add Criteria

Adding criteria, or filters, to your query provides you with greater control
over the data it returns. Use the Criteria pane on the right side of the
Designer tab to add filters to your query.
The Criteria pane is divided into two sections: the top section shows you the
filters that are already included in the query. The bottom section allows you
to define any new criteria for your query.
If you selected either or both of the options to Auto-Select Current History
Records or Filter to Active Employees, then automatically generated criteria
are already included in Criteria pane.
When adding a new filter to your query, you have the choice for two filter
options: an AND filter or an OR filter:
n An AND filter means this rule and the other criteria must be met to
return a record. To add an AND filter to your query, click at
the top of the section. This activates the Criteria Builder section of
the Criteria pane, which you can use to define the filter.
n An OR filter means that the query results can contain records that sat-
isfy one rule or another rule, but do not have to satisfy both. To add
an OR filter to your query, right-click and select Add new OR.
This adds an ANY OF line to your criteria statement and activates the
Criteria Builder section of the Criteria pane.

Within Query Builder, you can create three types of criteria:


n Column-Value criteria allow you to set criteria for a field to a specific
value or values. For example, you might create a filter to find employ-
ees within a specific department.
n Column-Column criteria return data based on their relationship to
other data in the database. Often, this is date-related information.
For example, you might create a filter to find all of an employee's
salary increase since the last performance review date.
n SQL criteria allow you to create complex filters that include
SQL statements. For example, you might create a filter to identify
blank fields in the database.

8 | Epicor Software Corporation


Introduction To Query Builder

Query Builder provides several operators to assist you in created targeted


query. The following table defines each of these operators:
Operator Value
= Equals
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
<> and != Not equal to
IN This option only appears when a code table is selected. It
allows for multiple selections from a list of values and indicates
that the results should be equal to any one of the selected val-
ues.
NOT IN This option only appears when a code table is selected. It
allows for multiple selections from a list of values and indicates
that the results should not be equal to the selected value or val-
ues.
LIKE Similar or equal, but allows the use of wild card values.
n % - Represents a string of zero or more characters (JobTitle LIKE
%manager%)
n _ – Represents any single character (Sm_th returns Smith and
Smyth)
n [ ] – Represents any single character in a range [a-g] or set
[abcdefg] (8[0-4]% returns 80640, 81528...; 8[135]% returns 81_ _
_, 83_ _ _, and 85_ _ _)
n [^] – Any single character not in a range [^a-g] or set [^abcdefg]

Query Tab
The Query tab provides direct access to the SQL code, and because of that,
you should have a strong understanding of the SQL programming language
before using this tool. There are two main uses for the Query tab: creating
new SQL queries and updating the SQL code for a query designed on the
Designer tab.
Limitations are in place to provide a safer tool that cannot be used to change
the data within the database. Be aware of the following security related
items when using the Query tab in Query Builder:
n Only Query Builder Administrator users can modify a query using the
SQL tab.

Epicor HCM | 9
Chapter: 1

n Only Select statements can be processed.


n Any SQL statement that updates or removes data will not be pro-
cessed (such as Insert, Update, or Delete statements).
n Removing the PersonGUID field from the SQL statement will remove
the row security from the query.
n Using the Query Builder Auto Format SQL feature enables the applic-
ation to attempt to format the SQL code. When writing SQL code with
numerous filters in the WHERE clause, you should turn off this fea-
ture.
n If any of the SQL code is modified on this tab, Query Builder will
attempt to interpret it and display it on the Designer tab. If the SQL is
too complex, Epicor HCM may not be able to interpret and display the
code. In that case, you can still view the output on the Results tab.

Results Tab
The Results tab displays the results from a query. From here, you can page
through the results, re-size columns, export the results to a Microsoft Excel
spreadsheet (click the MS Excel icon in the upper-right corner), and print the
query (click the printer icon). When view data on the Results tab, be aware of
the following:
n Query Builder enforces row security on the Results tab.
n Epicor HCM decrypts any encrypted fields.

10 | Epicor Software Corporation


Introduction To Query Builder

My Query Component
The My Query component is a home page component in Epicor HCM. Users
can display the My Query component on their My Home page.
The My Query component displays shared query, as well as the ones users
create themselves. To add the My Query component to your My Home page:

1. On the My Home page, click .

2. Click Add Component.


3. In the What Would You Like To Add list, select My Query.
4. In the Which Region list, select the area of the My Home page where
you would like the component to display, and then click OK.
5. Click Close to return to the My Home page.

When saving a query, you have the option to share the query. Select the
Share This Query check box to allow other uses to access your query from the
My Query component.
Shared Queries n Can be seen by all users on the My Queries component on the My
Home page
n Can be seen by all users on the My Queries component on the My
Home page
n Can be seen by all users on the My Queries component on the My
Home page
n Can be seen by all users on the My Queries component on the My
Home page
Private Queries n Can only been seen by creator and Query Builder administrators on
the My Query component
n Can only been seen by creator and Query Builder administrators on
the My Query component
n Can only been seen by creator and Query Builder administrators on
the My Query component

Epicor HCM | 11
Chapter: 1

Use Query Builder


Now that you have reviewed the main concepts of the Query Builder, you can
begin to create queries.

Create a New Person Query


Person queries start with the Person table and return data about the people
in your database. Use the following steps to create a new person query:
1. In Epicor HCM, navigate to the Reports menu, and then select Ad
Hoc Query Builder.
Query Builder opens in a new window.
2. From the File menu, select New Person Query.
Epicor HCM displays the New Person Query window.
3. In the Enter the query name field, enter a name for the new query.
You may use spaces in the query name; however, they will be
removed if you save the query as a view.
4. In the Enter a description for the query field, enter a detailed
description of the query and its intended function.
5. The Auto-Select Current History Records check box is selected by
default. If selected, this check box automatically adds a Cur-
rentFlag="1" filter to the query when any history table is added to the
query.
6. If your system is licensed for the Position Control & Budgeting mod-
ule, the Auto-Select Primary Position check box displays and is
selected by default. If selected, this check box automatically adds a
PersonJobCurrentFlag="1“ filter when the Person Job History table is
added to the query.
7. Select the Filter to Active Employees check box to limit the scope of
your query to current employees. If selected, the Query Builder adds
the Person Status History and Status tables to the query, and sets the
criteria for the PersonStatusCurrentFlag and the ActiveFlag to “1.”
8. Select the Share This Query check box to make the query available
for editing by Query Builder administrators, and available for viewing
by other Epicor HCM users on their My Home page.
9. Click OK to create the new query.
Query Builder opens to the Designer tab, showing the Person table
filtered according to the choices you made in the steps above.

12 | Epicor Software Corporation


Introduction To Query Builder

Add Tables and Fields to a Query


Once you have created the framework for your query, you can add tables and
fields to create a more meaningful and useful query.
1. In the Person query you just created, on the tPerson table, click the
.
The Related Tables form opens in a new window.
2. In the Search field, enter the table that you would like to add, and
then click .

3. Click the to add the table to your query, and then close the
Related Tables form.
The new table is now linked to the tPerson table on the Designer tab.
4. Open the Results tab.
Notice that no data returns. This is because you have not
added any fields to your query.
5. Return to the Designer tab.
6. Add fields to your query by selecting the check box next to the field
name.
7. Open the Results tab again.
You should now see data for the fields you added to the query.

Add Criteria
To modify the way the query searches for data, you can assign criteria to spe-
cific parts of the query to include or exclude certain field data.

1. In the Person query you just modified, click to activate the


Criteria Builder.
2. Select the Condition Type to use for this criteria. Select Column-
Value, Column-Column, or SQL. For the purposes of this example,
select Column-Value.
Depending on the condition type selected, the Criteria Builder dis-
plays additional options.
3. In the Select Table list, select the table to use in this criteria. For this
example, select tPerson.
4. In the Select Column list, select the field to use for this criteria. For
this example, select FirstName.

Epicor HCM | 13
Chapter: 1

5. In the Operator list, select the operator to use for this criteria. For
this example, select =.
6. In the Value field, enter the value to use for this criteria. For this
example, enter John.
7. Click Save.
8. Verify that the FullName field is included in the fields that are used
for this query.
9. Open the Results tab.
Only employees with the first name John are included in the results
of the query.

Manage Field Properties


Use the Fields tab at the bottom of the page to analyze a query. The fields
grid displays the field name, field name alias, filter flag, sort order, and vis-
ible flag.
Click in a cell to activate a drop-down list or text box that allows you to
change field information.

Manage Joins
Use the Joins tab to modify the joins between tables. Modifying joins allows
you to control how the relationship between tables are processed when a
query is run.
To change a join type, click the Join Type field between the two tables, and
then select the new join type.

IMPORTANT: Remember that if you change the join type


between two tables from an INNER join to an OUTER join, you
must also change the join type of any subordinate tables to an
OUTER join.
For example, if your query uses the tPerson, tPer-
sonLocationHist, and tDepartment tables and you change the join
between tPerson and tPersonLocationHist to an OUTER join, you
must also change the join between tPersonLocationHist and tDe-
partment to an OUTER join.

Save your Query


When you save a query, you have two options: save the query as a stand-
alone, or save it as a query and as a view. Saving a query as a view allows you
to use it as a data source in Report Builder.
To save your query as a stand-alone:

14 | Epicor Software Corporation


Introduction To Query Builder

1. From the File menu, select Save.


The Save Query form opens in a new window.
2. In the Enter a description of the query field, enter or update the
description of the query. If you entered a description when you first
created the query, that description automatically populates in this
field.
3. Select the Share This Query check box if you want to make the
query available to others people.
4. Click OK.

To save your query as a view, and, therefore, be able to use the query in
Report Builder:
1. From the File menu, select Save.
The Save Query form opens in a new window.
2. Select the Create a View check box.
The Enter a view name to create field appears with the name of
your query automatically populated.
3. Update the name of the SQL view or accept the default. Spaces and
special characters cannot be included in the view name.
4. In the Enter a description of the query field, enter or update the
description of the query. If you entered a description when you first
created the query, that description automatically populates in this
field.
5. Select the Share This Query check box if you want to make the
query available to others people.
6. Click OK. Epicor HCM saves the query to the Query Builder table
(USysQueryBuilderQuery) with a “vuser” prefix.

Before you can use the new view in Report Builder, you must first
regenerate the Reporting Model.
7. In Epicor HCM, navigate to the Utilities menu, and then select Sys-
tem Configuration Generate Business Library.
8. Clear the Update Business Assembly check box, and verify that the
Update Reporting Model check box is selected.

Epicor HCM | 15
Chapter: 1

9. Click Regenerate Business Library.


When the regeneration process finishes, the new view can be used in
Report Builder.

16 | Epicor Software Corporation


Chapter 2

Real-World Examples

Now that you have reviewed the basics Query Builder, you are ready to begin
using Query Builder to its fullest.

Concepts covered in this chapter include:

Employees and Current Location 18


Employee and Dependent 20
Name, Title, Pay, and Department 22
Add a Field to a Superview 24

Epicor HCM | 17
Chapter: 2

Employees and Current Location


The following query generates a list of all employees and their current loc-
ation.
Include the following fields in your query:
n Location Description
n Department Description
n First Name
n Last Name
n Employee ID

To create the query, complete the following steps:


1. Open a new Person Query, and the Filter to Active Employees check
box.
2. At the top of both the tPersonStatusHist and tStatus tables, click
to collapse them.
3. In the tPerson table, select the Employee ID, First Name, and Last
Name check boxes.
4. At the top of the tPerson table, click to open the Related Tables
search window.

5. In the Search field, enter locationhist, and then click .

6. Next to [tPersonLocationHist].PersonGUID, click .

7. Close the Related Tables window.


Query Builder adds the tPersonLocationHist table to your query.
8. In the tPersonLocationHist table, next to Department Code, click
.
Query Builder adds the tDepartment table to your query.
9. In the tDepartment table, select the Department Description check
box.
10. In the tPersonLocationHist table, next to Location Code, click .
Query Builder adds the tLocation table to your query.
11. In the tLocation table, select the Location Description check box.

Use the Fields/Joins pane at the bottom of the page to sort the results:

18 | Epicor Software Corporation


Real-World Examples

1. On the Fields tab, drag the rows so they are in the following order:
a. tPerson.PersonGUID
b. tLocation.LocationDescription
c. tDepartment.DepartmentDescription
d. tPerson.LastName
e. tPerson.FirstName
f. tPerson.EmployeeID
2. In the Sort Order list, select Ascending for the following fields:
n tLocation.LocationDescription
n tDepartment.DepartmentDescription
n tPerson.LastName
3. Open the Results tab.
Your query displays the list of all employees and their current loc-
ation, sorted by location description, department description and
employee last name.
4. Save the query as a stand-alone or as a view that you can use in
Report Builder.

Epicor HCM | 19
Chapter: 2

Employee and Dependent


The following query generates a list of all employees and their dependents.
Include the following fields in your query:
n Employee Full Name
n Dependent Full Name
n Relationship Description

To create the query, complete the following steps:


1. Open a new Person Query, and select the Filter to Active Employees
check box.
2. At the top of both the tPersonStatusHist and tStatus table, click
to collapse them.
3. At the top of the tPerson table, click to open the Related Tables
search window.

4. In the Search field, enter dependent, and then click .

5. Next to [tPersonDependent].PersonGUID, click .

6. Close the Related Tables window.


Query Builder adds the tPersonDependent table to you query.
7. In the tPersonDependent table, next to Dependent Person GUID,
click .
Query Builder adds the tPerson [Dependent] table to your query.
8. In the tPersonDependent table, next to Relationship Code, click .
Query Builder adds the tRelationship table to your query.
9. In the tPerson table, select the Full Name check box.
10. In the tPerson [Dependent] table, select the Full Name check box.
11. In the tRelationship table, select the Relationship Description
check box.
12. On the Fields tab, in the Sort Order list, select Ascending for the fol-
lowing Fields:
n tPerson.FullName
n Dependent.FullName

20 | Epicor Software Corporation


Real-World Examples

13. Open the Joins tab.


14. In the Join Type list, select LEFT OUTER for the following table joins:
n tPerson to tPersonDependent
n tPersonDependent to Dependent
n tPersonDependent to tRelationship
15. Open the Results tab.
Your query displays the list of all employees and their dependents (if
any), sorted employee full name and then dependent full name.
16. Save the query as a stand-alone or as a view that you can use in
Report Builder.

Epicor HCM | 21
Chapter: 2

Name, Title, Pay, and Department


The following query generates a list of all employees and their base pay, busi-
ness card titles and departments.
Include the following fields in your query:
n Employee Full Name
n Business Card Title
n Base Pay Amount
n Base Pay Frequency Adjective
n Department

To create the query, complete the following steps:


1. Open a new Person Query, and select the Filter to Active Employees
check box.
2. At the top of both the tPersonStatusHist and tStatus tables, click
.
3. At the top of the tPerson table, click .

4. In the Search field, enter JobHist.


5. Next to [tPersonJobHist].PersonGUID, click .

6. Change the search to BasePay, and then add [tPer-


sonBasePayHist].PersonGUID to your query.
7. Change the search to LocationHist, and then add [tPer-
sonLocationHist].PersonGuid to your query.
8. Close the Related Tables window.
9. In the tPerson table, select the Full Name check box.
10. In the tPersonJobHist table, select the Business Card Title check
box.
11. In the tPersonBasePay table, select the Person Base Pay Amount
check box.
12. In the tPersonBasePay table, next to Person Base Pay Frequency,
click .

13. In the tFrequency table, select the Frequency Adjective check box.

22 | Epicor Software Corporation


Real-World Examples

14. In the tPersonLocationHist table, next to Department Code, click


.
15. In the tDepartment table, select the Department Description check
box.
16. On the Fields tab, drag and drop the rows so they are in the following
order:
n tPerson.PersonGUID
n tDepartment.DepartmentDescription
n tPerson.FullName
n tPersonJobHist.BusinessCardTitle
n tPersonBasePayHist.PersonBasePayAmount
n tFrequency.FrequencyAdjective
17. In the Sort Order list, for the tDepartment.DepartmentDescription
field, select Ascending.
18. In the Sort Order list, select Descending for each of the following
fields:
n tPersonBasePayHist.PersonBasePayAmount
n tFrequency.FrequencyAdjective
19. Open the Results tab.
Your query displays the list of all employees, sorted by their current
departments, and then by their base pay amount and frequency.
20. Save the query as a stand-alone or as a view that you can use in
Report Builder.

Epicor HCM | 23
Chapter: 2

Add a Field to a Superview


Epicor HCM comes with several superviews already in place. However, there
may be times when you need additional information in superview.
For example, you might want to know the normal hours per week for all
employees. Instead of creating a new view, use the ActiveSuperview as a
base for a modified version of the superview.
The following query adds the Normal Hours per Week field into a new version
of the Active Superview. This custom Active Superview can then be used in
Report Builder.
Include the full list of fields from the ActiveSuperview and then add Normal
Hours per Week to your query.
To create the query, complete the following steps:
1. Open a new Table Query.
2. In the Enter the query name field, enter a name for the query, such
as ModifiedActiveSuperview.
3. In the Enter a description for the query field, enter a detailed
description of the modification you are making to the view, such as
Added Normal Hours per Week to the ActiveSuperview.
4. In the Select a starting table list, select vrptActiveSuperview.
5. If you intend to share the query, select the Share This Query check
box.
6. Click OK.
7. In the vrptActiveSuperview table, select the check box at the top left
of the table window to add all fields to the query.
8. On the vrptActiveSuperview table, next to Person GUID, click .

9. At the top of the tPerson table, click .

10. In the Search field, enter StatusHist, and then click .

11. Next to [tPersonStatusHist].PersonGUID, click .

12. Close the Related Tables window.


13. In the tPersonStatusHist table, select the Normal Hours Per Week
check box.

24 | Epicor Software Corporation


Real-World Examples

14. In the Criteria pane, right-click , and then select Swap Oper-
ator.
The criteria changes to .
15. Click to activate the Criteria Builder.
19. In the Condition Type section, select Column-Value.
20. In the Select Table list, select tPersonStatusHist.
21. In the Select Column list, select PersonStatusCurrentFlag.
22. In the Operator list, select =.
23. In the Value field, enter 1.
This criteria filters for employees' current status.
24. Click Save to set the criteria for this query.
25. From the File menu, select Save.
26. Select the Create a View check box, and then click OK.
27. In Epicor HCM, from the Utilities menu, navigate to System Con-
figuration Regenerate Business Library.
28. Clear the Update Business Assembly check box and verify that the
Update Reporting Model check box is selected.
29. Click Regenerate Business Objects. This process may take several
minutes to complete.

Once the business objects regeneration finishes, the new, custom superview
you created here is available to use in Report Builder.

Epicor HCM | 25

You might also like