Select Page

BAQs — Becoming One Data

A fundamental value of your Epicor ERP system is the data that it holds — all that data sits there, nicely organized and begging for consumption. But good data needs to be converted into information to be of value. As such, getting good data out of your ERP system is key. Often, it takes a good query to perform that information transformation. A Union query is one tool in the Epicor BAQ toolbox that can perform this action.

Data Server Epicor BAQs
Within the Epicor Business activity query toolset, Union queries combine multiple data sources into a single results set. Union queries are a great way to combine data from different tables that are, for whatever reason, sufficiently similar as to combine them into a single dataset. Some examples might include:

  • You are using the project module and wish to combine project phases and project tasks into one single set of activities
  • You are tracking the completion of manufactured parts in a mixed mode environment, and need to merge the Job Assembly and Job Material tables
  • You are reviewing sales activity for a customer and wish to combine open orders and open quotes

The UNION command in some ways functions like a JOIN command. It is used to select related information from two related tables. The biggest difference is in how the two tables are related and returned. A JOIN returns multiple table data elements combined into a single row, while with the UNION command, the records from different tables are returned as separate rows. It’s important to note the following: because records from different tables are being combined into a single set of rows, the rows returned need to be of the same data type. We will spell this out further below.

Let’s look at the attached Epicor BAQ example and better understand the UNION command in an Epicor business activity query.

The following query combines three sets of supply-side data into a single dataset:

  • Purchase Orders
  • Jobs
  • Inventory
SubQuery1 is the top-level query. It pulls data from the PartBin and PlantWhse tables:
Epicor SubQuery1
SubQuery2 is a Union query, from the JobPart and JobHead tables. Note: the data types are organized in the same order as the top-level query:
Epicor Kinetic SubQuery2
SubQuery3 is also a Union subquery that returns data from the PODetail and PORel tables:
Epicor Kinetic SubQuery3
Note: UNION command requires all selected columns to be of the same data type. If these returned values are not of the same type, you will receive error messages, per the screenshot below:
Epicor Kinetic Union Command
The value of Union queries is far-reaching. For example, the above query can then be used in a job shortage dashboard, such as the one below. In the following dashboard, the main query returns all past-due job material records where the material’s related operations have been started, but the material has not been issued. The main query published out the material part number, such that the child query can subscribe to this value and present the collected supply for the part in question, whether coming from inventory, from a job, or from a purchase order:
Epicor Kinetic Job

Need help with Epicor Kinetic BAQs?

Epicor Kinetic User Summit Fall 2021

Like BAQs? Looking for more Epicor Kinetic tips and tricks?

Meet us at the EstesGroup Kinetic Summit!

Join Us At Epicor Insights 2017

For a special gathering at Fuse Sports Bar.

You could win an Amazon Alexa and a two our business process review from Ben Nixon.

Join the fun as we talk Epicor and the issues you have in business.

Check your E-Mail for some special information.