Kinetic BAQDesignerUserGuide
Kinetic BAQDesignerUserGuide
The usage of any Epicor software shall be pursuant to an Epicor end user license agreement and
the performance of any consulting services by Epicor personnel shall be pursuant to Epicor's
standard services terms and conditions. Usage of the solution(s) described in this document with
other Epicor software or third party products may require the purchase of licenses for such other
products. Where any software is expressed to be compliant with local laws or requirements in this
document, such compliance is not a warranty and is based solely on Epicor's current
understanding of such laws and requirements. All laws and requirements are subject to varying
interpretations as well as to change and accordingly Epicor cannot guarantee that the software will
be compliant and up to date with such changes. All statements of platform and product
compatibility in this document shall be considered individually in relation to the products referred to
in the relevant statement, i.e., where any Epicor software is stated to be compatible with one
product and also stated to be compatible with another product, it should not be interpreted that
such Epicor software is compatible with both of the products running at the same time on the same
platform or environment. Additionally platform or product compatibility may require the application
of Epicor or third-party updates, patches and/or service packs and Epicor has no responsibility for
compatibility issues which may be caused by updates, patches and/or service packs released by
third parties after the date of publication of this document.
Epicor® is a registered trademark and/or trademark of Epicor Software Corporation in the United
States, certain other countries and/or the EU. All other trademarks mentioned are the property of
their respective owners.
All rights reserved. No part of this publication may be reproduced in any form without the prior
written consent of Epicor Software Corporation.
Table of Contents
Working with Business Activity Query (BAQ) Designer 6
3 October, 2023
Selecting a BAQ Search 76
Setting Up Execution Settings 81
Adding Execution Settings 81
Editing Execution Settings 84
Reviewing Execution Settings 86
Using Query Parameters 92
Creating BAQ Parameters 92
Creating BAQ Parameters in the Query Designer 97
Avoiding BAQ Constant Names 98
Using Parameters 99
Using SubQueries 102
Adding SubQueries 102
Defining SubQueries 104
Selecting Consistent Columns 112
Moving Items Between SubQueries 114
Creating a New SubQuery 114
Moving Items to an Existing SubQuery 116
Managing SubQueries 118
Copying SubQueries 121
Adding Referenced Queries (BAQ as a Source) 124
Selecting the Reference Query 124
Adding Referenced Queries to the Query Diagram 130
Testing the Referenced Query 133
Exporting and Importing Referenced Queries 136
Deleting Referenced Queries 137
Entering an Advanced Group By Clause 139
What Are Advanced Group By Clauses? 139
Advanced Group By Operators 139
Displaying Results Through Advanced Group By Clauses 140
Creating the Query 140
Adding the Table 141
Selecting Display Fields 142
Entering the ROLLUP Advanced Group By Clause 144
Entering the CUBE Advanced Group By Clause 146
Entering the GROUPING SETS Advanced Group By Clause 148
Aggregating Data Using PIVOT and UNPIVOT 150
Aggregating Data Using a PIVOT 150
Aggregating Data Using an UNPIVOT 162
Create the Query 163
Add the Inner SubQuery 163
4 October, 2023
Create the UNPIVOT Expression 166
Testing a Query 173
Analyzing a Query 173
Testing a Query 173
Technical Details 175
Viewing Where Queries Are Used 176
5 October, 2023
Working with Business Activity Query (BAQ)
Designer
The Business Activity Query (BAQ) Designer continues to incorporate more features
from the Classic user interface. Most BAQ features are available in the Kinetic user
interface. However the following feature is only in the Classic version:
l Updatable BAQs
Full BAQ Designer capabilities are coming in a later release. If you need to create a
query with the above feature, please use the Classic version accessible from within the
smart client.
Use the BAQ Designer to create new database queries (BAQs) and copy or modify existing ones.
You can use BAQs as data sources for Dashboards, Searches, or BAQ Reports. The exporting
capabilities makes the queries available to view and edit in third party applications.
Leveraging this functionality does require some knowledge of database concepts such
as table relationships, records, and field types. This knowledge helps you create
queries that have good performance and display the results you want. You start by
defining what information you want to display in your BAQ. You then find which
database tables contain the appropriate columns which hold this data. Application tools
can help you find this database information.
6 October, 2023
Using Database Viewing Tools
Kinetic contains tools to help you locate database information you need before you start designing
your custom query. These tools also reduce issues with your BAQs, as you can leverage them to
make sure you reference correct fields and tables within your modified and personalized queries.
Field Help
Use the Field Help feature to display the technical details on a specific field within. You activate Field
using the Help and Support panel.
For more information see Using the Help and Support Panel in Kinetic Home Page.
7 October, 2023
Once enabled, you can click question marks next to fields to open a Field Help panel.
l Description - Displays the concise explanation for the field. This text explains the field’s
purpose and other useful information.
l Field Name - Displays the selected field.
l EpiBinding - Displays the name to use if you want to link to this field through a customization
or a code reference. This value uses the ViewName.FieldName format. ViewName is the
name of the view on the user interface; FieldName is the database column name.
l DB Field - Value contains the information you most likely need for your BAQ. It displays the
table name and the column name for the selected field. Typically, this value is identical to the
EpiBinding value and it displays the true database name for the field.
l Format - Defines the layout for the characters within the field. This value displays in either
schema or alphanumeric format; for example, X(30).
l Decimals - If the field is a Decimal type, the Decimals field displays how many decimal
positions are available within the field.
l Data Type - Defines the selected field’s main data definition. The type defines the data that
appears within the field; for example; string, number and boolean (True or False).
l Column Label - If the field is displayed on a grid, this field indicates the text that appears at the
top of the grid column.
l Like - The Like value for the selected column. This value links the column to another column
on a different, or foreign, table. These columns share a logical link and can be used to display
the data shared by these linked tables.
8 October, 2023
BAQ Table Details Tab
Use the Table Details tab in BAQ Designer to view the list of fields and their Data Type. The
information is displayed for each table you place on a canvas.
9 October, 2023
Using the BAQ Designer Landing Page
When you launch the Business Activity Query Designer, the Landing Page displays. This Landing
Page is similar to landing pages in other Kinetic applications. Use it to find an existing business
activity query (BAQ) that you want to review or edit.
1. Select the Query List drop-down to filter the BAQs by Regular BAQs, External BAQs, and
other options.
2. Go to the Query ID field and select Search . Use the Search panel to find and select a
specific BAQ.
3. Select a column to sort the BAQs in ascending or descending order. Use any column to sort
the order by its values, such as Author, Updatable, Last Updated By, and so on. Select a
column once to sort the BAQs by ascending order; select a column twice to sort by descending
order. Clear the sort order by selecting the column a third time.
4. Select the Funnel icon to display the filter options for each column.
5. Go to a text column and enter a value in the field. Then select its Funnel icon. Use these
options to filter the BAQs:
l is equal to
l is not equal to
l Contains
10 October, 2023
l Starts with
l Ends with
6. Go to a check box column and select its drop-down. Use these options to filter the grid:
l All
l is True
l is False
7. When you find the BAQ you need to review or edit, select its link.
11 October, 2023
Creating a New Query
In this article, learn how to create a new business activity query (BAQ). You first define the query’s
identifier and description. You also indicate whether this query should be available to all users within
the company, available between multiple companies, and retrieve data across companies.
1. From the Kinetic menu, select Business Activity Query. It launches on a new page in your
browser.
2. In BAQ Studio Home Page, review the Query List drop down. The Regular BAQs option
displays by default.
To be able to select the 'External BAQ' option, you must authorize the 'External
BAQ Designer' security group for your user. You do this in the 'User Account
Security Maintenance' app. If you don't, then the 'Regular BAQs' option displays
and the field will be inactive.
You cannot create 'External Queries' if you are the 'Cloud' user.
12 October, 2023
To learn how to create an external query, review the article.
5. The Author field displays the name of the current user logged into the system. Other users
cannot modify this query (BAQ).
As a BAQ creator, you can assign author rights to another user. To do so, press
Search to find and select a new author. The new author now has rights to edit
the BAQ.
6. The Owning Company displays the company where you are creating the current BAQ. You
cannot change this value; only the author within the Owning Company can modify this query.
7. You restrict access to a BAQ using Security codes. Configure these codes in Menu Security
Maintenance; they each limit access to user groups, specific users, and/or both. To assign a
Security ID, press Search to find and select a security code.
8. Select the Shared check box to indicate this query is available to all users. After you save the
query, all users in your company can use it through the available BAQ functions, such as
Quick Searches, BAQ info zones, BAQ reports, and dashboards.
13 October, 2023
These users will need various rights to use these features. System managers
grant these rights to user accounts in User Account Security Maintenance.
9. The All Companies check box controls whether the current BAQ is visible to all companies on
the same database server. When Kinetic uses multiple companies within a single database,
the system applies BAQ use and visibility regardless of multi-company direct configuration.
For companies hosted on different databases, this check box launches Service Bus
processing to synchronize BAQs across external companies. If the custom BAQ is created
from a Company that runs under a multi-tenant license, the definition is visible to all
companies within the same Tenancy as the Owning Company.
l Only users within the original company can update the BAQ definition, but users can
review and run it within other companies. To modify the BAQ definition in other
companies, create a copy of the BAQ within each company that needs to change it.
l Each query that has the All Companies property must have a unique BAQ ID across all
companies.
l When you create a BAQ visible across companies in Company A, and Company B uses
a local BAQ with the same ID, a warning message displays. The system informs the
user that in Company B, the local BAQ is used and the BAQ created in Company A will
not be available.
l Likewise, a warning message displays when you create a local BAQ in Company A, but
in Company B another BAQ has the same ID and is visible to all companies. They
system states that the local BAQ takes precedence over the All Companies BAQ. The
same warning displays when you import a local BAQ that has the same ID as another
BAQ set for all companies.
l When a naming conflict occurs, the local BAQ always take precedence over the BAQ
visible to all companies.
To see which companies outside the current company references a BAQ, use the
Where Used option. Select this option from the Overflow menu .
10. The System BAQ option indicates whether the current BAQ installed with the Kinetic system.
You cannot change a system query, but they are a great starting point for creating your own
queries. Do this by copying and renaming it, modifying this copied query as you need. To do
14 October, 2023
11. The Cross-company check box controls if the BAQ brings back results across multiple
companies. To design a cross-company BAQ, a user must have Allow creation of cross-
company BAQ. A system manager assigns these rights in User Account Security
Maintenance.
12. The External Query check box indicates that this is an 'External Query'. This check box is
always inactive out but is automatically selected if the query you are building is external.
To learn how to enter an external query, refer to the Creating an External Query
article.
13. After you finish entering the main BAQ information, click Save .
15 October, 2023
Using the Query Designer
Use the Query Designer to create a Business Activity Query (BAQ). Use the designer to set up
everything from basic queries with a single table to complex queries that include multiple subqueries
of different types, joins, or query parameters.
Adding Tables
Use the Query Designer to first add the database tables that will pull data into your custom query.
l When you create a new query (BAQ), the first subquery the designer creates is
SubQuery1 by default. This is a TopLevel subquery type. Each BAQ must have
only one TopLevel subquery.
l Because all queries are subqueries of the database, the BAQ designer calls all its
levels subqueries, including the TopLevel subquery.
l You can add multiple Inner subqueries to a BAQ; these are embedded within the
WHERE clause of the TopLevel subquery.
3. Start by adding a table. Use the Search box to locate the table.
16 October, 2023
4. Either double-click it or select the table and drag it to the design canvas.
5. If you wish to remove a table, select the table and click the Trash button.
6. You can add multiple tables at once. To do so, search for and select tables you want to add
and drag them to the design canvas.
7. Use the Connected Tables panel to display tables that have relations with the table you select
on the canvas. The panel displays Extension Tables when the connection with the selected
17 October, 2023
table is defined in Extension Table settings.
8. When you place two tables on the canvas, and a relation between tables exists (described in
the dictionary), the Query Designer automatically adds the relation. The relation is shown by a
line that links the tables which indicates the JOIN clause. You can also manually create table
relations or replace existing relationships.
9. Each query (BAQ) can have multiple subqueries. Much like layers within a cake, you can link
subqueries to generate results specific for your industry or business area. Each subquery has
a different type. When InnerSubQuery or CTE type subqueries are in the current query (BAQ),
you can drag these subqueries on the canvas to also use the JOIN clause to link the subquery
to tables or other subqueries. This link the pulls data from the subquery into the current
18 October, 2023
subquery. For more information, see Using SubQueries.
1. Add tables to the design canvas. The layout buttons display in the upper right corner of the
design canvas.
2. Select the Fit to Screen button to display all the tables within the visible design canvas.
19 October, 2023
5. Select Restore to Scale to return the design canvas layout to its original size.
6. Select Layout Automatically to evenly space the tables around the design canvas.
The correct order of tables is crucial for retrieving the expected BAQ results. The first
table listed in the FROM clause of the resulting SQL statement is explicitly set on this
tab. The order of these other tables is based on table relations.
1. The current position of each table is represented by a number. To change the order of the
tables, select a table and use the Up or Down arrow on the toolbar to move the selected table
one position up or down. Use these arrows as you need to define the new table order.
2. In this example OrderHed table is first on the list, so the resulting syntax shows this table
order:
select *
20 October, 2023
OrderHed.Company = OrderDtl.Company
and OrderHed.OrderNum = OrderDtl.OrderNum
3. By making the OrderDtl table first on the list, the resulting syntax changes to this table order:
select *
The correct order of tables is a crucial step in retrieving the expected BAQ results.
l Matching rows from {left joined table} and {right joined table} - This is the default join; the
subquery only selects rows that satisfy the join criteria from both joined tables. The query
results from this join type include all the records where the table relations values in both tables
match. A record in one table only displays if a corresponding record in the joined table links to
it.
The join between the Customer (table1) and the OrderHed (table2) creates a
view that displays customers and sales orders. In this example, the view only
includes customers who have placed an order. Records for any customers who
have not placed an order are excluded from the query results.
21 October, 2023
l All Rows from {left joined table} -The subquery selects rows that satisfy join criteria from both
joined tables as well as all rows from the left joined table -- including its Null rows. The
subquery displays everything from table1 and linked rows from table2.
Use the All Rows from {left joined table} join to view all customers (table1) and
the sales orders (table2) for these customers. This query also displays every
customer who has not placed an order. If a customer did not place an order, fields
that display the order information are blank.
l All Rows from {right joined table} - The subquery selects rows that satisfy join criteria from
both joined tables as well as all rows from the right joined table -- including its Null rows. The
subquery displays everything from table2 and linked rows from table1.
Use the All Rows from {right joined table} join to find each employee (table1) and
his or her department (table2), but still show departments that have no
employees.
l All Rows from {left joined table} and {right joined table} - The subquery selects rows that
satisfy join criteria from both joined tables as well as all remaining rows both from the left
joined table and the right joined table along with Null rows. In SQL, this type of join combines
the results of both left and right outer joins and returns all (matched or unmatched) rows from
the tables on both sides of the join clause.
22 October, 2023
Use the All Rows from {left joined table} and {right joined table} to show all the
Customers (table1) and all the sales orders (table2) in the database.
1. When you place two tables on the canvas and they have a relationship described in the
dictionary, a line displays that indicates the JOIN clause. The Query Designer supports
automatically creating JOIN clauses between standard Kinetic tables, Kinetic tables and
Extension tables, and Extension tables. In this example, QuoteHed and Customer tables are
on the canvas.
23 October, 2023
l When the relation is between two standard tables, the default relationship uses the Matching
rows from {left joined table} and {right joined table} join type, which means that data from the
first table only displays if it links to data within the second table. The query output from a
Matching rows join includes all the records in which the table relation values in both tables are
an exact match. Records from either table that do not have a match in the other table are not
included in the query results.
l When relation is between standard and extension tables, the default relationship uses the All
Rows from {left joined table} join type, which means that join criteria includes all rows from
the standard table and only includes matching rows from the extension table. The designer
selects data between the two tables using the Extension Table settings.
l When relation is between two extension tables, the default relationship includes all rows from
the parent table and only matching rows from the child table.
2. If a predefined relationship exists between the selected tables, you can use the Dictionary
panel to view and select one of the predefined join types. When you place two tables on the
design canvas, and the relationship between these tables is described in the dictionary, the
SubQuery Designer automatically uses this default join type. As you place a subsequent table
on the design canvas, the SubQuery Designer checks the relation with the previous table
within the table order. It does not check relations to all possible tables within the query. The
Dictionary panel also displays number of predefined dictionary relations.
24 October, 2023
3. The Dictionary panel lists all relations with their fields. The result relation join type expression
displays in the Expression field. You can select one of the relations and press Replace In
Query. Fields from the Dictionary will replace fields used in the current BAQ relation.
25 October, 2023
4. In this example, the designer modified the default relation between the tables to use
QuoteHed.ShipToCustNum instead of QuoteHed.CustNum.
1. In this example, assume you want to connect the Terms and APInvHed table. Create a join by
dragging and dropping between them. Make sure the tables connect with the line.
26 October, 2023
2. You can use the Table Details tab to see if the tables share any common fields you could use
to create a table relation. In this example, the Company and TermsCode fields are in both
tables.
3. To define the table relation, select the line between the tables. With the Table Relations tab
selected, press New.
4. Create a join between the first and second table. In this example, you select the Company and
TermsCode columns to join the tables.
27 October, 2023
5. You have the following options to create a relation:
l Create a simple join between table fields using the field1 = field2 pattern.
l Construct an advanced expression, for example, using functions or operations different
from = (equals). There is no list of predefined operators, you can enter a custom
expression.
l When the tables you add are not joined by any field, the designer automatically selects
the CROSS JOIN (Cartesian join). This join returns all records where each row from the
first table is combined with each row from the second table.
l When you apply criteria on the FIRST table in the query, these criteria go to the WHERE part
of the resulting SQL statement.
l When you apply criteria on a table other than the first query table that is connected to the
previous table with a JOIN clause, the BAQ designer applies these criteria to the JOIN clause
in the ON condition within the resulting SQL statement.
l Consider leaving the query criteria open. You then have more flexibility within the query, as
you can always add a filter to the query results within a dashboard or a BAQ report.
To add table criteria:
28 October, 2023
1. Select a table on the canvas for which you want to filter the data.
2. Select New .
3. In this example, you add a filter on the OrderHed table to only display open orders. From the
Field Name, select OpenOrder.
4. The Operation field defines how the system evaluates the selected field against the Filter
Value. In this example, accept the default = (equals) option. The Filter Value can be an
alphanumeric value.
Operator Description
> Greater than
< Less than
= Equals
>= Greater than or equals
<= Less than or equals
<> Not equal or not identical to
BEGINS Returns data that starts with the same characters. Although this operator is
less efficient compared to the Greater than or Equal sign (>=), you can use
this value to pull in a series of records that start with the same set of
alphanumeric characters.
29 October, 2023
Operator Description
MATCHES Returns data that is exactly the same as the character string. Although this
operator is less efficient compared to the Equal sign (=), you can use asterisk
wildcards to pull in data. For example: MATCHES '*owe*' finds both owe and
powerful. With MATCHES, you can use no asterisks, a left asterisk, a right
asterisk or both asterisks.
ISNULL Returns fields that have an unknown, or "NULL" value. Typical uses cases
include:
l Find rows with the EMPTY string value, use comparison with an empty
constant. The example of an empty constant looks as follows:
EXISTS The EXISTS condition is considered to be met if the subquery returns at least
one row. This condition can be used in any valid SELECT SQL statement.
The syntax for the EXISTS condition looks as follows:
SELECT columns
FROM tables
WHERE EXISTS ( subquery )
With this operator selected, the only Filter Value available is "a row in
specified subquery".
LIKE Determines whether a specific character string matches a specified pattern
defined in the Filter Value. A pattern can include regular characters and
wildcard characters.
5. Now, specify the Filter Value. First, select an option from the drop-down list. In this example,
select the specified constant option. Click on specified to invoke the Specify Value sliding
panel. For Value, enter False and press OK.
30 October, 2023
Filter Description
specified Use this option to filter the data using a field from a table included in the
table field query.
value l From the Table Name drop-down list, select the table that contains the fields
you want to filter against. All the tables available in your current subquery
display.
l The available fields display in the fields section. Select the field you want to
use in the criterion and press OK.
31 October, 2023
Filter Description
specified Use this option to filter the data against a specific value you define.
constant l You can enter any text value you need. Depending on what you enter, some
values may or may not be case sensitive.
l Enter the value you want to filter against and press OK.
specified Use this option to filter the data against a specific expression you create.
expression You can use this filter to build complex expressions calculate when the sys-
tem applies the criterion to the query.
l The Specify Expression panel has a free form text field. You can use this
field to directly enter the expression.
l You can also use the Data and Functions Nav Trees to select items for the
expression. The Nav Trees on Specify Expression panel are similar to the
Calculated Field Editor panel. Learn more about this panel by reviewing the
Creating Calculated Fields help article.
l Enter a valid SQL Expression and press OK.
32 October, 2023
Filter Description
specified Use this option to filter the data using an alternative parameter value(s)
parameter defined for a BAQ. You can also use parameters to display customized
method arguments for use in Business Process Management (BPM) dir-
ectives.
l In the Select Parameter window, specify the parameter and press OK.
For example, you create a parameter listing part numbers. When the query
runs, the Define Parameter window displays, asking a user to select a part.
The selected part value is dynamically used in the specified condition. To
create parameters, use the Query Parameters option found on the BAQ
Home Page overflow menu.
For more information, see Using Query Parameters.
33 October, 2023
Filter Description
BAQ spe- Use this option to filter against a specific constant, like CurrentCompany,
cial con- CurrentEmployeeID, First Day of the Month, Fiscal Period, and so on. The
stant query pulls data based on the BAQ constant you select. To review the com-
plete last of BAQ constants, review the Calculated Fields - Functions, Oper-
ators and BAQ Constants section in the Creating Calculated Fields help
article.
l From the list, select a BAQ constant and press OK.
34 October, 2023
Filter Description
Current Use this option to filter query results by date intervals: days, weeks, months,
date + spe- and years. The result is always evaluated against the current company date
cified inter- (TODAY). You can enter a positive or negative value; the value is then
val added or subtracted from the current company date to calculate a different
date.
l Use the controls to define the next execution date.
l The current date is retrieved from Constants.Today. This constant allows to
set the date according to the time zone based on the company location.
35 October, 2023
Filter Description
selected Use this option to filter the data using values of a subquery field(s) you
value(s) of define.
field from l Press selected to toggle between:
specified
l ALL - the condition evaluates against all values returned from a
subquery
subquery.
l ANY - comparison with at least one value returned from a subquery.
l Press specified to invoke the Select SubQuery panel. From the drop-down,
select a subquery. Note only InnerSubQuery and CTE subqueries display on
this list.
l Select a Field against which you want to filter data.
36 October, 2023
Filter Description
Operation For certain operations, only specific filters are available for use.
specific fil- l IN operation:
ters
l specified constants list - Use this filter to specify the list of constants.
l specified list parameter - Use this filter to select an Item List
parameter you want to use in the query execution. This parameter
contains a list of values supplied during query execution.
l field from specified subquery - Use this option to filter the data using a
subquery field(s) you define. You can select fields from InnerSubQuery
or CTE subqueries.
l EXISTS operation:
l a row in specified subquery - Use this option to filter the data using a
subquery you define. You can select InnerSubQuery or CTE
subqueries. This operator only checks that a row is returned.
l CONTAINS operation:
l specified contains expression - Use this filter to launch the Specify
Expression window. Use this form to create an expression compatible
with the CONTAINS predicate in SQL. Supported terms: AND (&), OR
(|), wildcard (*), parentheses (()). Full-text indexed column is required.
37 October, 2023
Specifying SubQuery Criteria
Use the SubQuery Criteria tab to limit BAQ results by adding filtering conditions on the selected
subquery.
l In the resulting SQL statement, the subquery criterion displays in the WHERE
part of the subquery.
l When you select the Having check box to indicate the subquery should meet
specified conditions, the criterion displays within the subquery's HAVING part of
the resulting SQL statement.
1. First, select a subquery where you want to apply a filter. In this example, the BAQ uses two
subqueries joined using the UNION operator to return customer Quotes and Orders. We will
create a filter on each SubQuery to display data for a particular customer.
38 October, 2023
2. Go to SubQuery Criteria tab and press New .
3. A new row displays in the SubQuery Criteria grid; enter the options you need for this filter. In
this example a criterion displays to return quotes for the customer Addison.
Entering a condition for the subquery is similar to entering Table Criteria. For a
subquery, first use the Alias field to select a subquery table or a predefined Calculated
table name, when referring to calculated fields. In this example, the Customer table is
selected.
39 October, 2023
4. Create a condition by selecting the subquery Field Name, Operation and Filtering Value.
For a complete list of Operations and Filtering options, see Specifying table
criteria.
5. When you select the Having check box, the SQL statement returns rows where aggregate
values meet the specified conditions. Typically you use this field with the calculated field
editor. In this example, we keep this option clear.
6. Similarly, we enter the criteria for the second SubQuery2. In this example, we limit the BAQ
results to only retrieve orders for the customer Dalton.
40 October, 2023
8. The following is an example of a Query Phrase that has filtering applied on both subqueries.
41 October, 2023
Selecting Display Fields
In this article, learn how to select the fields that display on your query, modify how these how these
fields display, change their column order, and remove them from display. You can also create
calculated fields, add and edit field attributes, and create advanced group by expressions.
2. If multiple tables are used in a SubQuery, select a table from the Available Tables list.
3. The columns appear that are available within the table. You can search for fields or sort
columns by Name, Data Type, and Description.
42 October, 2023
4. Select the fields you want to display.
If you select fields and then use a column search filter that does not include
these field names, your selected fields no longer display. When you clear this
filter, your selected fields display again.
5. Click the Right Arrow button to move the selected column(s) into the Display Fields(s) list.
1. Change the field name by entering a value in the Label field. This field displays the default field
name, but you can change the name. The name you enter displays on the column header
within the BAQ results grid.
43 October, 2023
2. To change the field's format mask, modify the value in the Format field. Use these options in
various combinations to display the results in the format you want. Several single character
format options are available:
l X - Any Character
l N - Number or Letter
l A - Letter Only
l ! - Lower Case Letter
l 9 - Number Only
l > - Suppress Zeros
For example:
l X(8)
l ->>>,>>>,>>9.9999
3. To group query results by specific column, select the Group By check box.
When selected, this field is listed in the Group By SQL clause as well as in the
Select clause. The Group By statement is often used in conjunction with
aggregate queries utilizing aggregate functions, such as AVG, SUM, or COUNT.
1. To move a field or multiple fields up in the column order, select a field(s) and use the Up Arrow
button.
44 October, 2023
2. To move a field or multiple fields up in the order, select a field(s) and click the Move to Top
button.
3. To move a field or multiple fields down in the order, select a field(s) and click the Down Arrow
button.
4. To move a field or multiple fields down in the order, select a field(s) and click the Move to
Bottom button.
45 October, 2023
Searching for Fields
If you need to find a specific field, use the grid filter options.
2. The grid filter row displays. Enter a value in one of the columns. For example, in the Label
column, enter order.
3. Click the Funnel button on the column. Select a filter option, such as Contains, Starts with,
Ends with, and so on.
The Display Fields grid only shows the fields that match your filter parameters.
Removing Fields
You can also remove fields from the BAQ results grid.
46 October, 2023
2. Click the Remove fields button.
2. Select the Calculated fields editor to create a field that generates results through a
calculated expression you define. To learn more, review the Creating Calculated Fields help
47 October, 2023
article.
3. Each field has a series of attributes you can use for Advanced Unit of Measure,
Configurator, and other functions. To learn about creating and editing them, review the
Defining Field Attributes help article.
4. An Advanced Group By clause groups the BAQ results using an expression, generating
results the shows more details about the data. For example, use the GROUPING SETS
function to group records together by sets of multiple values. Read the Entering an Advanced
Group By Clause help article for more details.
48 October, 2023
Creating Calculated Fields
Create user-defined columns that calculate a value using selected fields within the query. You can
then see additional information specific to your industry or business area. You build these fields
using the Calculated Field Editor panel. This panel contains lists of fields, functions, and operators.
These default items display in a Nav Tree where you can find the item you need. You can also
directly enter the expression in the Editor field.
49 October, 2023
5. The Calculated Fields panel slides on.
50 October, 2023
Creating a Calculated Field
Add the calculated field to the grid.
2. In the Field Name field, enter the name of the field for which you create the calculation. In this
example, enter BurdenHrs.
You can create calculated fields that have the same name in different queries, but you
cannot create two identical calculated fields within the same query. When you copy a
subquery that contains a calculated field, you will enter an alias name for the field.
3. Enter the Data Type this calculated field generates, such as decimal. Available data types
include:
51 October, 2023
l nvarchar (alphanumeric)
l int (integer)
l decimal
l date
l datetime
l bit (Boolean Y/N)
4. The Format field automatically displays the data format for this calculated field. In this
example, ->>,>>>,>>9. If you need, change this value.
5. Enter the Label you want to display above this calculated field’s column header in the BAQ
grid. In this example, enter Burden Hours.
6. Optionally, enter a Description.
52 October, 2023
For a complete list of these options, see the Calculated fields - Functions,
Operators and BAQ Constants section.
3. Expand the node that has the function you want, such as Aggregate.
4. Select the function, such as Sum(x). Either double-click or drag and drop it onto your
calculation within the Editor field. The selected function displays in the editor.
5. Use the Data tab to search for and place a specific field within the calculation.
6. Expand the nodes on the Data Nav Tree to pull data from:
l Display Fields - Select any of the current Display Fields and Calculated Fields in the
current subquery.
53 October, 2023
l Available Tables - Pull in any fields contained within the tables you have included with
the current subquery.
l Parameters - If you have created parameters for the query, these options display under
the Parameters node. Parameters pull in multiple values that you can then use within
your calculation. For more information, see Using Query Parameters.
You cannot create a calculated field with a parameter that uses the Skip
condition if empty property. These parameters do not display on the list of
available parameters.
l Be sure to use the appropriate SQL syntax within the Editor pane.
l The Editor supports intelligent code editing, which includes invoking
member lists. To invoke a list of columns for a table, enter the name of the
table followed by a dot (.) and press Ctrl + Space. Select the column you
need, it will be added to the table name. For example,
ABCCode.Company.
7. Expand the node that has the data you want, like the Available tables node.
54 October, 2023
10. If the expression is valid, the Syntax OK message displays.
11. Press Apply.
12. The calculated field is now added to the list of Display Field(s).
Functions
55 October, 2023
Users are not limited to the functions from the Nav Tree. You can place any function
supported by the SQL Server your system uses within an expression. For External BAQ
functionality, use functions supported in the database server where the external BAQ
runs.
l Aggregate - aggregate functions perform a calculation on a set of values and return a single
value. Aggregate functions are frequently used with the GROUP BY clause of the SELECT
statement.
Function Description
Avg(x) avg(expression)
Calculates the average of all values within the numeric database field.
Count(x) count(expression)
Counts the number of times the database field was counted.
Max(x) max(expression)
Calculates the maximum of all of the values of the numeric database field.
Min(x) min(expression)
Calculates the minimum of all of the values of the numeric database field.
Sum(x) sum(expression)
Calculates the total of all the values of the numeric database field.
l Math - mathematical functions execute mathematical operations usually based on input
values that are provided as arguments, and return a numeric value as the result of the
operation.
Function Description
Abs(x) abs(expression)
Returns the absolute value of a numeric expression.
Sqrt(x) sqrt(expression)
Returns the square root value of a decimal expression.
Power(x, power(expression, exponent)
y) Returns the expression raised to the power of a decimal expression.
Log(x) Log(expression)
Calculates the natural (e) logarithm of a decimal expression.
Log10(x) Log10(expression)
Calculates the base-10 logarithm of a decimal expression.
(x modulo (top expression % bottom expression)
y) Returns the remainder of the top decimal expression divided by the bottom
decimal expression.
56 October, 2023
Function Description
Round(x, round(expression , precision )
y) Rounds a decimal expression to a specified number of places after the decimal
point.
Truncate round (expression, precision, 1)
(x, y) Truncates a decimal expression to a specified number of decimal places,
returning a decimal value.
l String - string functions manipulate a string or query information about a string.
Function Description
ASCII(x) ASCII(expression)
Converts a character expression representing a single character into the
corresponding ASCII value, returned as an integer.
Char(x) Char(expression)
Converts an ASCII integer code to its corresponding character value.
Len(x) Len(expression)
Returns the number of characters in an expression
Left-Trim ltrim(expression)
(x) Removes leading white space from a string expression.
Trim(x) ltrim(rtrim(expression))
Removes leading and trailing white space from a string expression.
Right-Trim trim(expression)
(x) Removes trailing white space from a string expression.
Substitute Substitute(base-string [, arg ] ...)
(x[, y, ...]) Returns a character string that is made up of a base string plus the substitution
of arguments in the string. An argument is referenced in string by &num
identifier where num is 1-based argument index in argument list.
Substring substring(expression ,position ,length)
(x,y,z) Extracts a portion from a string expression.
Replace Replace(expression ,search ,replace)
(x,y,z) Performs a search and replace function on a string expression.
Upper(x) upper(expression)
Converts any lowercase characters in a string expression to upper-case
characters.
lower(x) lower(expression )
Converts any upper-case characters in a string expression to lowercase
characters.
57 October, 2023
l Date - there are a number of date functions available in Kinetic.
Function Description
Date(year, convert(date, expression, 112)
month, Converts a string expression in 'yyyymmdd' format into date value.
day)
Year(x) datepart(year, expression)
Evaluates a date expression and returns the year value of that date, including
the century, as an integer value.
Month(x) datepart(month, expression)
Evaluates a date expression and returns a month integer value from 1 to 12.
Day(x) datepart(day, expression)
Evaluates a date expression and returns a day of the month as an integer value
from 1 to 31.
WeekDay datepart(weekday, expression)
(x) Evaluates a date expression and returns the day of the week as an integer
value from 1 (Sunday) to 7 (Saturday) for that date.
Add- dateadd(interval-unit, interval-amount, expression)
interval Adds a date interval to, or subtracts a date interval from, specified expression.
(x,y,z) Expression should be of date type. To subtract, enter interval-amount as a
negative value. Interval-unit is one of the following words: year, month, week,
day.
l Conversion - conversion functions transform an expression of one data type to another
Function Description
DateToString(x) convert(varchar, expression, date-format-index)
Converts a date value into a character value using a date format index.
Default 101 results in 'mm/dd/yyyy' string.
TimeToString(x) convert(varchar, expression, time-format-index)
Converts an integer value into a character value using a time format
index. Default 108 results 'hh:mi:ss' string.
DecimalToString convert(varchar, expression)
(x) Converts a decimal value into a character value.
IntToString(x) convert(varchar, expression)
Converts an integer value into a character value.
Integer(x) convert(int, expression)
Converts an expression of any data type to a value of integer data type.
Decimal(x) convert(decimal, expression)
Converts an expression of any data type to a decimal value.
58 October, 2023
Function Description
Date(mm,dd,yyyy) convert(datetime, convert(char, _year_*10000 + _month_*100 + _
day_), 112)
Converts a set of month, day, and year values into a date value.
Replace _year_, _month_ and _day_ placeholders with references to
fields of integer type or constant values.
StringToDate("x") convert(date, expression, date-format-index)
Converts a string date representation (expression) into a date value
based on date format index. For example, if the input string contains a
date like '07/21/2012', then date format index should be set to 101.
IntToDateTime(x) convert(datetime, expression)
Converts an integer expression, into a date value. The expression is
treated as number of days after 01/01/1900.
Logical(x) convert(tinyint, expression)
Converts any data type into the logical data type.
l Ranges - functions in this category return the position, string entry, or number of elements
from the list, based on the expression.
Function Description
Lookup [Ice].lookup(expression, list)
(x,y) Returns an integer value giving the position of an expression in a list. Returns a
0 if the expression is not in the list.
Lookup [Ice].lookup(expression, list, separator )
(x,y,z) Returns an integer value giving the position of an expression in a list. Returns a
0 if the expression is not in the list.
Entry(x,y) [Ice].entry(expression, list, ',')
Returns a character string entry from a list based on an integer position.
Entry [Ice].entry(expression, list, separator )
(x,y,z) Returns a character string entry from a list based on an integer position.
Num- [Ice].num_entries(list)
entries(x) Returns the number of elements in a list of character strings as an integer
value.
Num- [Ice].num_entries(list, separator)
entries(x,y) Returns the number of elements in a list of character strings as an integer
value.
l Financial - functions in this category return either the fiscal year or fiscal period for the
supplied date based on the fiscal calendar.
59 October, 2023
Function Description
FiscalYear(x) FiscalYear(company, date)
Returns fiscal year for passed date according to fiscal calendar in the
database.
FiscalPeriod FiscalPeriod(company, date)
(x) Returns fiscal period for passed date according to fiscal calendar records in
the database.
For more information on converting one data type to another, for example when
converting date and time formats, see CAST and CONVERT (Transact-SQL).
Operators
An operator is a mathematical expression either used with a single function or used to process two or
more functions.
Editor
Section Tree View Expression
View
Arithmetic Add (x + y) (+) Addition operator.
Adds two numeric expressions. Adds days to
date (date + days).
Arithmetic Divide (x / y ) ( / ) Division operator.
Divides one numeric expression by another
numeric expression, producing a decimal result.
Arithmetic Modulo (x (x modulo Modulo operator.
modulo y) y) Determines the remainder after division.
Arithmetic Multiply (x * (*) Multiplication operator.
y) Multiplies two numeric expressions.
Arithmetic Negate ( - x) (-) Unary negative operator.
Reverses the sign of a numeric expression.
Arithmetic Subtract (x - (-) Subtraction operator.
y) Subtracts one numeric expression from another
numeric expression.
Boolean Equal (x = y) (=) Equal operator.
Returns TRUE if two expressions are equal.
Boolean And (x and y) and And operator.
Returns TRUE if each logical expression is
TRUE.
60 October, 2023
Editor
Section Tree View Expression
View
Boolean Or (x or y) or Or operator.
Returns TRUE if either of the two logical expres-
sions is TRUE.
Boolean Not (Not x) not Not operator.
Returns TRUE if an expression is false and
FALSE if an expression is true.
Comparison Equal (x = y) = Equal operator.
Returns TRUE if two expressions are equal.
Comparison Greater Than >= Greater Than or Equal operator.
or Equal (x Returns TRUE if the first of the two expressions
>= y) is greater than or equal to the second expres-
sion.
Comparison Greater Than > Greater Than operator.
(x > y) Returns TRUE if the first of the two expressions
is greater than the second expression.
Comparison Less Than or <= Less Than or Equal operator.
Equal (x<=y) Returns TRUE if the first of the two expressions
is less than or equal to the second expression.
Comparison Less Than (x < Less Than operator.
< y) Returns TRUE if the first of the two expressions
is less than the second expression.
Comparison Not Equal (x <> Not Equal operator.
<> y) Compares two expressions and returns TRUE if
they are not equal.
Condition If x Then y (case If-Then-Else condition.
Else z when Evaluates and returns one of the two expres-
then else sions, depending on the value of a specified con-
end) dition.
Condition Case x When case Evaluates a list of conditions and returns one of
y Then z when multiple possible result expressions.
Else k end then
when
then
else
end
61 October, 2023
Editor
Section Tree View Expression
View
Other Comment /* */ Comment characters.
Allows adding explanatory text to a procedure
between the /* and */ characters.
Other Begins Begins Begins operator.
Tests a character expression to see if that
expression begins with a second character
expression.
Other Matches “* *” Matches operator.
Compares a character expression to a pattern
and evaluates to TRUE if the expression sat-
isfies the pattern criteria.
BAQ Constants
The following table displays the BAQ constants you can use within the Calculated Field Editor.
l Anytime the server code resolves Today or Now the method returns the value
based on the company time zone setting. If not set, it will use the app server time
zone.
l When a BAQ runs, Today and other dependent constants, as well as the current
date value for current date-based condition, are calculated one time per query
run, and their values are based on the company time zone of the company from
which the BAQ is executed. For a Cross-Company BAQ, it means the value of
Today and dependent constants is calculated based on company time zone of
user’s current company; it is not recalculated for each company from which the
data is retrieved by Cross-Company BAQ.
62 October, 2023
BAQ Constant Descriptio
CurCompName The Company Name of the company the user is logged into.
Note: This constant is used for compatibility with queries written
in Epicor 9 after they were migrated or imported into Epicor
ERP Version 10. When building a new BAQ, use the Cur-
rentCompanyName constant.
CurLangID The language ID of the language being used in the Main Menu
of the current session.
Note: This constant is used for compatibility with queries written
in Epicor 9 after they were migrated or imported into Epicor
ERP Version 10. When building a new BAQ, use the Cur-
rentLanguageID constant.
CurrentCompany The Company ID of the company the user is logged into.
CurrentCompanyName The Company Name of the company the user is logged into.
CurrentEmployeeID The Employee ID linked to the user of the current session.
CurrentLanguageID The language ID of the language being used in the Main Menu
of the current session.
CurrentPlant The Plant ID of the company the user is logged into.
CurrentTime The current system time. Returns seconds elapsed since mid-
night.
CurrentUserID The User ID of the user of the current session.
Day The day of month of the Current Date.
DayOfWeek Returns the current day number of the current week.
DefUM The default Unit of Measure of the current site.
Note: This constant is used for compatibility with queries written
in Epicor 9 after they were migrated or imported into Epicor
ERP Version 10. When building a new BAQ, use the DefaultUM
constant.
DefaultUM The default Unit of Measure of the current site.
DesignMode Indicates the special developer mode for Epicor developers is
used.
EmployeeID The employee id linked to the user of the current session.
FirstDayOfMonth The first day of the current month of the Current Date.
63 October, 2023
BAQ Constant Descriptio
FirstDayOfNextMonth The first day of the next month of the Current Date.
FirstDayOfNextWeek The first day of the next week of the Current Date.
FirstDayOfPrevMonth The first day of the previous month of the Current Date.
FirstDayOfPrevWeek The first day of the previous week of the Current Date.
FirstDayOfWeek The first day of this week of the Current Date.
GlobalSecurityManager The current session user is a Global Company Security Man-
ager.
LanguageID The language ID of the language being used in the Main Menu
of the current session.
Note: This constant is used for compatibility with queries written
in Epicor 9 after they were migrated or imported into Epicor
ERP Version 10. When building a new BAQ, use the Cur-
rentLanguageID constant.
LastDayOfMonth The last day of the month of the Current Date.
LastDayOfNextMonth The last day of the next month of the Current Date.
LastDayOfNextWeek The last day of the next week of the Current Date.
LastDayOfPrevMonth The last day of the previous month of the Current Date.
LastDayOfPrevWeek The last day of the previous week of the Current Date.
LastDayOfWeek The last day of the current week of the Current Date.
MobileConnect Indicates the Mobile Connect mode is running.
Month The current month of the Current Date.
PlantID The Plant ID of the company the user is logged into.
Note: This constant is used for compatibility with queries written
in Epicor 9 after they were migrated or imported into Epicor
ERP Version 10. When building a new BAQ, use the Cur-
rentPlantID constant.
ProductCode The application product code. The available options include
"EX" for Express, "ST" for Standard, "EN" for Enterprise and
"Epicor" for any other product line.
ProductName The application product name. The available options include
Express, Standard, Enterprise and Epicor.
64 October, 2023
BAQ Constant Descriptio
SecurityManager The current session user is a Security Manager.
Today The Current Date.
Tomorrow The next day after the Current Date.
VersionString Displays the ICE framework assemblies version of the current
product.
Week The current week of the Current Date.
WorkstationDescription The description of the Workstation ID specified in Workstation
Maintenance.
WorkstationID The ID of the workstation specified in Workstation Main-
tenance.
Year The current year of the Current Date.
Yesterday The previous day of the Current Date.
65 October, 2023
Defining Field Attributes
Use the Field Attributes Panel to add, edit or remove attributes of the fields that display on your
query.
Each database field has a set of properties such as format or label. Using the Field Attributes Panel,
you can modify the existing properties and create custom ones for the current BAQ. When the BAQ
runs, it uses the field attributes you define.
This feature set is similar to Extended Property Maintenance. Use this application to
modify the properties of fields in an application. Use the Field Attributes panel to add or
modify properties on the fields in your query.
66 October, 2023
4. The Display Fields drop-down list contains all the fields you selected to display on the query.
Select a field from the list.
67 October, 2023
Attribute Name displays the field attribute's name. When you create a custom attribute, you
can either select one of the predefined attribute types from the drop-down list, or, you can
enter a name of your choice as needed. Attribute names are not case sensitive.
Is Overridden check box is visual indicator if the field property is in it's default state or if it was
created or modified in any way.
68 October, 2023
5. Select New to add new attributes.
6. You can edit Attribute Name directly in that grid or modify them in the Field Attributes panel.
When you change database value of an attribute, the Is Overridden check box is selected
automatically.
Use the Reset Field Attributes Cache action to immediately remove the server-side cache that
stores system Field Attributes data and apply the changes you made to the field attributes in the
query. When the query runs, it uses these modified field attributes.
69 October, 2023
Now when you run this query, it uses the attributes you defined on the Field
Attributes panel.
70 October, 2023
Defining the Sort Order
Use the Sort Order feature to define how the query results display when the query (BAQ) runs. You
can sort your data through any combination of columns. You can also select whether the data
displays in ascending or descending order.
If your query contains two or more subqueries, you can only select fields for the sort
order on the TopLevel subquery. If you define the sort order on a different subquery,
you will receive an error and the query does not run.
71 October, 2023
5. Select a column from the Available Fields grid that will sort the data and press the Right
Arrow button or drag and drop it. The selected field display in the Sort By grid.
6. Continue to add more fields to further define how the records sort.
7. If you need, use the Up and Down Arrow buttons to change the sorting order.
8. To control if data should sort in ascending or descending order, select the Sort by ascending
check box. You can either accept the default value of true (selected), or clear the Sort By
ascending check box to set the field to descending order.
9. Test the sorting results. Select the Run Query button.
72 October, 2023
10. Analyze and Test the query.
11. The query results display in the sort order you selected. The records sort in ascending order by
Warehouse, by Part, and then by Bin.
73 October, 2023
Defining BAQ Searches
Make your custom query available for searching in multiple applications by using the BAQ Search
panel. You select columns in your query that link to columns in other tables. When users launch a
search panel that links to these columns, your query displays as a BAQ Search option.
BAQ searches create this link by using the LIKE property. When two columns share a LIKE property,
the BAQ search can pull in records for display within the current application. For example, you create
a custom BAQ for the Part table. You select the Part_PartNum column as the first column in the BAQ
search. Any search panels that have columns that share the LIKE property with the Part_PartNum
column will include your custom query as a BAQ Search option.
You cannot use system queries for BAQ search options. If you want to add a system
query, copy this query and select this copied query for your BAQ search.
2. Select the Shared check box. Only shared queries will display for other users on the BAQ
Search panel.
74 October, 2023
3. Go to the Overflow menu and select BAQ Search.
4. The BAQ Search panel displays. The columns you selected for display in your BAQ appear in
the Available "Like" Columns list.
5. Select the check box next to each column you want to use in the BAQ Search.
7. Your selected columns display in the BAQ Search "Like" Columns grid.
75 October, 2023
The sequence in which you select columns for display is important. When users
run the query, the system uses the first column that shares the same
LIKE property as the search field LIKE property. This can cause unexpected
search results. For example, if the search field is Part_PartNum and the first
column with a LIKE property in the BAQ search sequence is the GlbPart_
GlbPartNum column, the BAQ search uses the Global Part (GlbPartNum) column
to pull search results. If the Global Part LIKE column has no values, the BAQ
search will return records without values in this column.
8. You can remove columns from this grid. Select the check box next to the column.
76 October, 2023
2. Go to the Landing Page. Click the Search icon in the Customer field.
3. The Search panel displays. Click the Search Type drop-down list and select BAQ.
4. The Search panel displays the BAQ Search options. Click the Search Id drop-down list and
select your custom query, such as InvoiceQuery.
77 October, 2023
5. The Search Results grid displays the data from your custom query.
6. You can keep this BAQ Search as a personal search option. Select the Save Search button.
78 October, 2023
7. The Personalize Search panel displays. Enter a Search Name that helps you identify the
search option.
8. If you want to make the BAQ search the first option that displays in the Search panel, select
the Default Search check box.
79 October, 2023
10. The BAQ Search now becomes a Personal search option.
80 October, 2023
Setting Up Execution Settings
Modify BAQ execution parameters to change how the query runs and displays its results set. You
can set up paging parameters to indicate how the BAQ should get a sub-selection of data from a
record set, specify the longest time in which the query can run, or supply SQL statements, clauses,
and keywords to modify the resulting SQL syntax.
2. Select Use Primary Database to run the query against your main database. If this check box
is clear, the query runs against a read-only database.
81 October, 2023
When you activate the Always On availability groups feature on the SQL server,
BAQs can run against a read-only database. If your company does not have a
read-only copy of the main database, all standard BAQs run against the main
database regardless of whether you select the Use Primary Database check box.
If the query is updatable, the system automatically selects the Use Primary
Database check box. Updatable queries must access and update current data.
82 October, 2023
4. Start typing in the blank field to see the list of execution settings. Select a setting. Read the
Reviewing Execution Settings section below for details on each setting.
83 October, 2023
8. The setting displays on the Query Executing Settings grid.
84 October, 2023
2. Select the link for the execution setting.
85 October, 2023
3. The options for the selected setting display. Enter the changes you need.
Setting Description
GenerateExecution Shows you the query execution plan returned by the query results. The
Plan query uses this plan in the Get Query Execution Plan action.
GroupBy Setting name for a comma-delimited field list by which you sort query
results. Make sure you reference fields using the BAQ Alias notation in
the following format: TableName_FieldName
Having Setting name for condition that appears in the HAVING clause in addition
to query settings. Make sure you reference fields using the BAQ Alias
notation in the following format: TableName_FieldName
86 October, 2023
Setting Description
NeedTotal Specifies if the total number of rows in the query is received (without
paging). If this flag is set to True, the ExecutionInfo table in the result
dataset that returns contains the total number of rows.
OrderBy Setting name for comma-delimited field list by which you want sort the
query result. Optional direction can be specified in SQL notation
(ASC/DESC). Make sure you reference fields using the BAQ Alias
notation in the following format: TableName_FieldName
PageCount Specifies how many pages of data the query returns. By default,
PageCount is set to 1 which means that the returned data displays on a
single page. You can set this value to any positive number greater than
0.
Paging Method Specifies the method used to retrieve data from the datasource.
Available values include:
l Auto - The default paging method. When selected, the query tries
to automatically select the most appropriate paging method,
supported by the BAQ definition and the database engine.
l Simple - When a query runs, its results return through
DbDataReader, but only the required page loads into the result
table. This paging should run for any database, so use it when the
Auto method does not work.
PageNum Specifies the page number user wants to get. The default value is 1.
Be aware that if you set this value to 10 (for example), but the BAQ only
returns 3 pages of data, the query displays an empty result set.
87 October, 2023
Setting Description
PageSize Specifies how many rows per page the query retrieves in the result set.
Available values include:
Persistent in Query Select the Persistent in Query check box so the query uses all execution
settings each time the BAQ runs. If a BAQ runs a subsequent execution
setting and an original setting is still active, the first setting has higher
priority.
If the Persistent in Query check box is clear, the settings only run once
during the current BAQ session. You must close and relaunch the BAQ
before the settings run again.
88 October, 2023
Setting Description
queryMax ResultSet Specifies maximum number of rows this query returns.
QueryOption Allows adding a query OPTION (<setting value>) to the query. You can
then add specific hints that affect how the query runs.
For example:
RemoveTest Controls if the BAQ Designer can return more than 10000 rows while
RowLimit testing BAQs.
This parameter has no affect on other query limits you may specify; it
only controls the data retrieval limit while testing BAQs.
ShowStatistics When this execution setting is set to true, then the system requests Time
and IO statistics from the SQL server while the query runs. The results
return as part of ExecutionInfo table and are shown in the Query
Execution Messages panel as SQL Server statistics.
89 October, 2023
Setting Description
SQLServer Adds SET DATEFORMAT call at the beginning of the query. Only the MS
DateFormat SQL Server should use this setting. Available options:
Transaction Isol- Sets transaction isolation level which controls the locking and row
ation version behavior of Transact-SQL statements. These statement are
issued by a SQL Server connection.
Available options:
90 October, 2023
Setting Description
UseAlternate Com- If you upgrade from a pre-10.2.700 Epicor ERP installation and your
panySecurity BAQs have poor performance, use this setting to restore query
performance.
Alternately, if you use SQL Server 2016 or older, make sure your query
contains a FOR XML PATH clause. In newer SQL Server versions, you
can replace this clause with the STRING_AGG function.
91 October, 2023
Using Query Parameters
You can filter query data using parameters values. These parameters can be nearly any value that
you can filter against within your query. You can also use parameters to display customized method
arguments for use in Business Process Management (BPM) directives.
92 October, 2023
4. First, enter Parameter Name, such as PartValues.
5. Select Data Type. The available options include nvarchar, int, decimal, date, datetime, bit,
uniqueidentifier and bigint.
6. The Format field displays the default format for the selected Data Type. If you need, you can
edit this value. Be sure this format value follows database conventions.
7. Use the Editor Type drop-down list to select how you will define the parameter values.
Available options:
l Common Editor - Activates the Default Value field. Enter a custom text value you need
for the parameter. The field selected on the criterion then evaluates against this default
value.
l Radio Button Set - Activates the Values Editor. Use this sheet to define the radio
button options this parameter will use. The field selected on the criterion then evaluates
against these multiple options.
l DropDown List - Activates the Data From drop-down list and the Values Editor. The
Data From defines the type of data you enter on the Values Editor. The field selected on
the criterion then evaluates against the options contained on the drop-down list.
l Item List - Select this option to create the list of values this parameter will use. The field
selected on the criterion evaluates against these item list options.
93 October, 2023
8. When you select the DropDown List Editor Type, the Data From drop-down list activates. Use
this list to define the source of the drop-down list options. Depend on what option you select,
enter different items in the Values Editor.
Option Description
Custom The Values Editor displays controls for creating a list of values. Define the
Values various list options this parameter will display and use. The field selected on the
criterion then evaluates against these item list options. Enter the following
information:
l Value - Enter the actual value of the parameter that is sent to the query.
l Display text - Enter the text that displays for this value on the drop down
list.
l Order - Defines the sequential order in which the options display on this
drop down list.
BAQs The Values Editor displays controls for selecting a BAQ. Enter the following
information:
94 October, 2023
95 October, 2023
9. If this parameter is required in order for the BAQ to pull in query results, select the Mandatory
check box.
10. Use the Sequence Order on form field to indicate the order in which parameters display on
the Specify parameters values panel.
11. Select the Skip condition if empty option when you want the BAQ to ignore this parameter
when it returns a blank, or empty, value.
If the parameter is empty, the BAQ ignores the criterion with this parameter. For example, in
the condition StartDate > @param1, the param1 value returns null. If you select the Skip
condition if empty check box, the BAQ does not check the criterion specified for the StartDate
field.
You cannot use BAQ parameters that have this property enabled within the
Calculated Field Editor. If a parameter referenced in a calculated field uses this
property, you see the following error message when you analyze or save the
query: "Expression of calculated field <FieldName> references optional query
parameter <ParameterName>."
96 October, 2023
Creating BAQ Parameters in the Query Designer
You can also create parameters as you enter table criteria or subquery criteria within the Query
Designer.
1. Select the table or subquery. In this example, select the Part table.
2. Select either the Table Criteria or SubQuery Criteria tab. In this example, select the Table
Criteria tab.
5. Select the Filter Value drop-down list and select specified parameter.
97 October, 2023
6. Click the specified link.
7. The Select Parameter panel slides on. Select the Add icon .
8. The Query Parameter panel slides on. Enter your new parameter.
DO NOT enter parameter names identical to the following BAQ Constant names:
l CompanyID
l CompanyName
l CurComp
l CurCompName
98 October, 2023
l CurrentCompany
l CurrentCompanyName
l CurrentEmployeeID
l CurrentPlant
l CurrentUserID
l EmployeeID
l GlobalSecurityManager
l IsMultiTenant
l PlantID
l SecurityManager
l UserID
l WorkstationDescription
l WorkstationID
Using Parameters
After you create parameters, use them in your query. In this example, the query lists all the parts in
your database. You want to prompt a user to select a specific part and then filter the BAQ results
using this part parameter.
1. First, define the query parameter. In this example, create a drop-down list that displays
specific part numbers.
99 October, 2023
2. Next, define the table or subquery criteria. In this example, create a table criterion for the Part
table. For Field Name, use PartNum and for the Filter Value, select specified parameter.
Each BAQ always contains one subquery that uses the TopLevel type. This subquery type is
required on all BAQs. If the BAQ has multiple subqueries, they link to the TopLevel subquery. These
other subqueries use different types (INNER, UNION, EXCEPT, and so on) to indicate how they
work with each other to generate result sets.
l Support of widely used query criteria, such as IN ({inner subquery}) or EXISTS ({inner
subquery})
l Querying hierarchical data using Common Table Expressions (CTE) with recursion and
UNION ALL
l Using CTE and inner subquery in the FROM clause and joins
l Using set operations, like UNION, UNION ALL, EXCEPT, and INTERCEPT
The above set operators are the methods that combine result sets. You create one
TopLevel subquery and use SQL standard keywords to combine its result set with other
subqueries that use different types.
Adding SubQueries
When you construct a query, you can add different types of subqueries and indicate how they relate
to each other. Add a subquery in two ways:
2. You can also create subqueries from the SubQuery List panel. Go to the Overflow menu and
select SubQueries.
Defining SubQueries
You next define how each subquery interacts with the previous subquery. Frequently this is the
TopLevel subquery.
1. When you create a new BAQ, the BAQ designer adds a TopLevel SubQuery1 by default.
2. To change the subquery parameters click the Overflow menu and select SubQueries.
5. In the Name field, accept the default name (SubQuery1, SubQuery2, and so on) or enter a
name that helps identify the purpose of the subquery. You cannot enter a name that is the
InnerSubQuery Usually added to the WHERE clause of the SQL statement as a nested
query inside another query. You typically use an inner subquery when
you know how to search for a value with the SELECT statement but do
not know the exact value.
7. In the Result Set Rows field, select how data displays in the subquery results set. The
available options include:
l All - default value; the SELECT ALL statement returns all data without restriction.
l Distinct - The SELECT DISTINCT statement specifies that only unique rows can display
in the result set.
l Top - The SELECT TOP statement specifies the number of rows or percent of rows to
return. You can specify either the number or percent of rows the result set displays.
Selecting the With Ties option specifies that the query result set includes additional rows
that match the values in the ORDER BY column or columns in the last row the query
returns. This may cause more rows to return. You can only specify the Top and With
Ties combination in SELECT statements, and only if you specify the ORDER BY clause.
l DistinctTop - The SELECT DISTINCT TOP corresponds to using DISTINCT and TOP
clauses at the same time. The query results set contains top unique rows.
8. When you select the Top or DistinctTop option in the Result Set Rows drop-down list, you can
specify the Top Clause. This disables the Order By OFFSET - FETCH Clause pane.
9. When you select the All or Distinct option in the Result Set Rows drop-down list, the Offset
and Fetch fields activate. Enter values in these fields to get only a window or page of results
from the result set.
For example, you can construct a BAQ against the employees table. By entering 5 in the
Offset field, the query skips the first five rows from the sorted result set. By entering 10 in the
Fetch field, the BAQ returns next 10 rows from the employees table. This query syntax looks
like this:
select
[EmpBasic].[EmpID] as [EmpBasic_EmpID],
[EmpBasic].[FirstName] as [EmpBasic_FirstName],
[EmpBasic].[LastName] as [EmpBasic_LastName]
from Erp.EmpBasic as EmpBasic
order by EmpBasic.EmpID OFFSET 5 ROWS FETCH NEXT 10 ROWS ONLY
l The number and the order of the fields (columns) must be the same in all subqueries.
l The data types must be compatible through implicit conversion.
l The BAQ takes field aliases from the first subquery; these field aliases must be different in
subsequent subqueries to generate the result set.
To select consistent columns between the previous and subsequent subqueries:
1. In a TopLevel or CTE type, define the set of display column(s). In this example, SubQuery1
displays four columns in this order:
3. Press Display Fields and add the same number of fields to match the previous subquery. The
fields must have the same or compatible data types and display in the same column order. In
this example, the column mapping of SubQuery2: Union looks like this:
l The Alias field displays the field name of the current subquery column. The
subquery takes field aliases from the previous TopLevel or CTE subquery.
l Each SubQuery treats Group By independently. You can construct a BAQ where
only one subquery aggregates data, for example:
3. The Move item(s) to SubQuery panel slides on. The Create New SubQuery radio button is
selected by default. Use this option to create a subquery from the selected item.
The new subquery displays on a separate tab. The selected table or subquery appears on the design
canvas.
7. Return to the previous subquery. The selected table or subquery no longer displays within this
subquery.
3. The Move item(s) to SubQuery panel slides on. Select the Move To Existing SubQuery radio
button.
Managing SubQueries
Use the SubQuery List panel to view and manage all subqueries you create within the BAQ.
Subqueries are placed in a sequence identified by a number. The sequence number defines the
order in which subqueries run to build the final SQL statement. The exception to this processing are
inner subqueries. If a subquery contains a reference to an inner subquery, the inner subquery
generates on demand and inserts data where the subquery requires it.
Use the SubQuery List to define how the subqueries run to generate the results set:
4. Move the subquery lower in the sequence by selecting the Down arrow .
Top
Inner <- some separate inner SubQuery
Union <- fields are selected according to the Top field list
Top
(Inner <- groups with next Union
Union)<- Fields correspond to Inner SubQuery
In this example, notice the TopLevel subquery displays at the top of the SQL statement, followed by
the second Union subquery.
4. The Copy Subquery panel displays. Either use the New SubQuery Name or enter a different
name.
5. Likewise, the copy function generates tables alias for all the tables in the copied subquery.
Either use the New table names or enter different names.
6. Select Ok.
After you add the referenced queries, define the table relations and criteria for them. The referenced
queries then run with the main query, displaying their data in custom grids, BAQ reports, quick
searches, predictive searches, and so on.
- Each query can only reference twelve other queries by default. If you need BAQs to
reference more queries, your system manager (on-premise environments) or the Cloud
Support Team (Cloud environments) can increase this limit.
- Referenced queries CANNOT reference another query. Kinetic does not have the
ability to resolve nested calls to the database.
- All referenced queries MUST use the same datasource. You cannot reference both
internal and external BAQs in the same query.
1. Launch the Business Activity Query Designer. Go to System Management > Business
Activity Queries > Business Activity Query (BAQ).
4. The Referenced Queries panel slides on. Press the Add icon.
5. The Search panel slides on. Enter the search values you need to find the query, then press
Search.
8. If you want to track this referenced query by a different ID in the main query, enter this value in
the Reference As field.
Use this field when you want to add the same query multiple times to the main
query. You then can connect the referenced query instances to different
tables on the Query Diagram.
9. Indicate how this query will pull its data. Go to the How to Execute drop-down and select one
of these options:
l Use Table variable - Pulls data using the Table name. This option runs before the main
query, and the referenced data populates the main query separately from the tables that
the main query contains. This call only runs once, so it typically is more efficient than a
CTE subquery. However this option does not work as well if the referenced query needs
to pull over a 1,000 rows. If you need to pull this much data into your main query, use the
Temp table option instead.
l Use Temp table - Pulls data first by populating an in-memory Temp table and then
pulling the data from the temp table into the main query. Like the Table variable option,
this option runs before the main query, and the referenced data populates the query
separately from the tables that the main query contains. This call only runs once, so it
typically is more efficient than a CTE subquery. This option works well if you need the
referenced query to pull more than 1,000 rows of data.
Reference queries that execute using the Table variable and Temp table
options can return a maximum of 10,000 rows by default. If you need these
BAQs to return more rows, your system manager (on-premise
environments) or the Cloud Support Team (Cloud environments) can
increase this limit.
10. If the referenced query has parameters, they display in the Map Parameters grid. Define how
the referenced query handles these parameters by selecting the parameter and then the drop-
down arrow.
l Show in parameter list with prefix - The main query runs this parameter as defined in
the referenced query by using the <ReferenceName>_<ParameterId> syntax.
l Set empty value - When the main query runs, this parameter is blank. The user must
enter a value to pull results into the referenced query.
l Map to existing query parameter: <Parameter Name> - Select the link to a parameter
that exists in the referenced query. The main query then uses this existing parameter.
l Set to scalar parameter value: <specify value> - Select the specify value link to define
a value for the parameter. When the main query runs, it uses the value you entered for
the parameter to determine what data displays in the query results.
13. The query you selected displays on the Referenced Queries panel. Press Add to select
another query that you will reference in the main query.
3. Select the SubQueries tab. The Referenced Queries category displays all the query
references available in the main query.
5. Select the table that you want to connect to the referenced query.
6. Drag a line from the blue dot on the selected table to the referenced query.
8. Select the Join Type between the table and the referenced query. Available options:
l Matching rows - Only rows that have matching records in both the parent table and the
referenced query display in the results.
l All rows from <Parent Table> - All rows from the parent table along with matching
records from the referenced query display in the results.
l All rows from <Referenced Query> - All rows from the referenced query along with
matching records from the parent table display in the results.
9. Now define the relationship between the parent table and the referenced query. Select a
column that both items share. This example shows that both the parent table and the
referenced query share the CustID (Customer ID) column, so you enter this expression:
l CustID = Customer_CustID
As a good business practice, you should typically link tables and referenced
queries by their Company and ID columns.
10. Now select the fields you want to display in the query results. Press the Display Fields button.
11. Go to the Available Tables drop-down and select the referenced query.
12. Go to the Available Fields grid and select the fields (columns) you want to display in the query
results.
13. Press the Right Arrow button. The field appears in the Display Fields grid.
14. Repeat these steps to add more fields to the Display Fields grid.
15. Use the Up Arrow and Down Arrow buttons to change the position where these fields display
in the query results.
1. Before you test, review the main information for the query. Select the Details button on the left
toolbar.
2. Review the Query Phrase. The join expression for the referenced query appears at the bottom
of the phrase.
5. If the query expression, criteria, and relationships run without errors, the "Syntax is OK"
Message displays at the bottom of the BAQ Designer.
6. You can test referenced queries to make sure they work. If any parameters from a referenced
query are not mapped to a query, they are available to test as well. Use this feature to test
what data returns from a referenced query or parameter. Go to the Test Entire Query or
Switch to (Sub)Query drop-down and select the referenced query or parameter.
7. Press Test.
8. If the referenced query or parameter runs as expected, you see the "Syntax is OK" message.
Some validations may not work when you run a partial test against a referenced
query or parameter.
9. Test the entire query. Go to the Test Entire Query or Switch to (Sub)Query drop-down and
select Query.
11. If the referenced query has parameters, the Specify parameter values panel slides on. Enter
the parameter values defined on the referenced query, such as starting with ADDISON and
ending with DALTON.
13. The grid displays the rows you selected through the parameters. For this example, the
columns from the referenced query display on the right side of the grid - the Cust. ID and
Website columns. The Website data from the referenced query matches each Customer row
from the main query.
You can now use the main query in custom grids, BAQ reports, quick searches, predictive searches,
and so on.
Likewise, if you import a query with referenced queries that are not in the target environment, the
following error message displays:
You can stop or continue importing the main query. If you continue importing it, the query will not
work unless you also import the referenced queries into this target environment or change the query
so it no longer needs them.
When you import the query and its referenced queries are in this environment, the imported query
and its referenced queries will run as expected.
1. Return to the Business Activity Query Designer and select the query you need to change.
3. The Referenced Queries panel slides on. Select the referenced query that you want to
remove.
5. You are asked if you want to delete the selected row. Press Yes.
The referenced query no longer displays on the Referenced Query panel. The referenced query is
removed from the Query Diagram and its fields no longer display in the query results.
Advanced Group By Clauses are more complex summarizing expressions. They can do the
following:
For example, in an Advanced Group By clause, you can organize the query results so
they display groups of related data. You have a query that pulls in all the purchase
orders you have sent to suppliers in different countries. By using the GROUPING SETS
operator, you organize the purchase orders by country. Each country set then has a
total cost for all the purchase orders, a subtotal cost by country, and a grand total cost.
You create these clauses in the Advanced Group By Clause SQL Editor panel.
Function Description
ROLLUP The ROLLUP operator generates reports that contain subtotals and totals. It
creates a result set that shows aggregate values through a hierarchy of the
selected columns. One row then generates with a subtotal for each unique
combination of (a, b, c), (a, b), and (a) values. This operator also generates a
Grand Total row.
GROUPING Generates multiple groups of data into separate sets. Only specified groups
SETS aggregate instead of the entire aggregations that generate by the CUBE and
ROLLUP operators. The results are similar to a UNION ALL relationship for the
specified groups. GROUPING SETS can contain a single element or a list of
elements. They can also create groupings similar to the ROLLUP or CUBE
operators. Each GROUPING SET can contain ROLLUP or CUBE operators.
You can enter expressions that group the data in several ways. Learn more about the
options you can select within the Functions, Operators, and BAQ Constants section in
the Creating Calculated Fields help article.
5. Select Save.
7. Enter a criterion that filters the query results to only display data from the 1032KNUT part:
5. Now create the calculated field. Select the Calculated Editor button.
6. The Calculated Fields panel slides on. Select New to add a calculated field.
8. Select the int (integer) Data Type and accept the default Format.
10. Enter the calculated expression in the Text Editor. This expression totals the On Hand
Quantities for the part. Either use the Data and Functions Nav Trees or directly enter the
expression.
l sum(PartBin.OnhandQty)
2. The Advanced Group By Clause SQL Editor panel displays. Select New to add a clause.
3. Enter the Advanced Group By clause. Either use the Functions Nav Tree or directly enter the
clause. Enter the ROLLUP operator and the Warehouse Code and Part Number you
selected to display.
l ROLLUP(PartBin.Warehouse, PartBin.PartNum)
8. The ROLLUP clause shows how many parts are in each warehouse and then the subtotal
quantity for the warehouse. The last row displays the grand total quantity.
l CUBE(PartBin.Warehouse, PartBin.PartNum)
5. The query results show all the different expressions. Each warehouse displays its subtotal
quantity for part 1032KNUT. It then shows the grand total quantity. For the next part of the
You can use either the InnerSubQuery or CTE subquery types to aggregate data using
the PIVOT and UNPIVOT operators. When you use a CTE subquery, place it as the first
subquery. It provides the base data for the rest of the query expression.
5. Select OK.
That is all you do to the TopLevel subquery for now. Later you will add the PIVOT expression to this
TopLevel subquery.
3. Go to the Tables panel. Use the Search field to find the OrderHed table.
6. Either double-click or drag the Customer table to the design canvas. These tables share a
logical link in the database, so a line displays this JOIN relationship.
9. Go to the Available Fields grid and find CustID. Click the Right Arrow button to move this field
to the Display Field(s) grid.
11. Go to the Available Fields grid and find OrderNum. Click the Right Arrow button to move this
field to the Display Field(s) grid.
5. Now either accept the default value or enter the Format you need.
7. Either use the Data and Functions Nav Trees or directly enter the calculated expression. This
expression locates the year during which each order was entered into the database:
l datepart(year,OrderHed.OrderDate)
5. The Pivot SubQuery FOR Clause tab displays below the design canvas.
6. Go to the PIVOT aggregate formula field and select the wrench icon.
7. The Pivot Aggregated Expression Editor panel slides on. Go to the Data Type drop down list
and select Int.
9. This panel is similar to the Calculated Fields panel, as it has both Data and Functions Nav
Trees. Either use the Nav Trees or directly enter the calculated expression. If you use the Nav
Trees, add items by either double-clicking or dragging them into the text editor. This
expression counts how many orders were entered in the database:
l count( OrderHed_OrderNum )
You are not limited to using only the functions from the Nav Tree. Any function
supported by the SQL Server that Kinetic uses can also be in your expression. In
External BAQs, use functions supported in the database server from where the
external BAQ runs.
11. Now specify the FOR clause for the PIVOT statement. In this example, you define which years
you want in the output. Go to the Pivot column and select the Calculated_OrderYear column.
You created this calculated field to return the year during which each sales order was entered.
13. Click on the Filter Value drop down list and select specified constant list.
15. The Enter Value List panel slides on. Select New to add a value.
16. Enter a value for each year that you want to include in your query results.
2. Select the fields you wish to display on your query results. From the Available Tables drop
down list, select InnerSubQuery.
3. Select the CustID field and all the years you entered within the value list.
For the Display Columns, do not add fields used in the PIVOT formula or in the
FOR clause. You can select other columns from the source subquery, like the
value list, for display.
7. The Query Results grid shows all the customers in your database and how many orders each
customer placed during each year you included in the query.
3. The Sub Query panel slides on. Enter a Name like InnerSubQuery.
6. Now add the UD01 table to the InnerSubQuery. Go to the Query Designer.
l UD01_Company
l UD01_Key1
l UD01_Key2
l UD01_Number01
l UD01_Number02
l UD01_Number03
l UD01_Number04
l UD01_Number05
5. The UnPivot SubQuery FOR Clause tab displays below the design canvas.
6. Go to the PIVOT aggregate formula field and select the wrench icon.
7. The Unpivot column name panel slides on. Go to the Data Type drop-down list and select
Integer (int).
9. Enter the Name that helps you identify the column, such as Numbers.
11. Enter the Pivot column. This is the column that will contain all unpivoted column names. For
this example, enter Field.
14. The Specify table fields panel slides on. Select New to add a field.
l UD01_Number02
l UD01_Number03
l UD01_Number05
2. Select the fields you wish to display on your query results. From the Available Tables drop
down list, select InnerSubQuery.
l UD01_Company
l UD01_Key
l Field
l Numbers
7. The Query Results grid shows all the numbers within the UD01 table. The UNPIVOT
expression display each number on a separate row.
Run the data controls to verify that the data results you need populate on this grid. If you are not
seeing the results you want, you can return to the Query Builder to modify the query and then test the
results again.
Analyzing a Query
1. Select Run Query.
2. Press Analyze Query.
3. The Problems panel displays the response from the server, indicating whether the syntax is
correct. If the BAQ Designer detects any SQL syntax errors, the panel displays the message
corresponding to error.
Testing a Query
1. To set the maximum number of rows returned by the query, you can select a value from the
Rows to Return list. The available options include All (default), 10, 50 and 100.
On-premise installation note: this feature is only available for BAQs executed in
an MS SQL database. The SQL Server account used by your Kinetic installation
must be provided with the ALTER ANY CONNECTION and VIEW SERVER
STATE permissions to cancel query execution.
Technical Details
When using Analyze, Test, and Get List buttons, as well as when the query runs, the query checks
its tables and displays the query results.
For standard tables, which are in the Ice or ERP database schema, the BAQ Designer verifies the
tables publish through zData and that the query syntax runs without errors. For Extension set tables
that are installed in the system, but disabled or not mapped in the current company, a warning
message displays in the Query Execution Messages pane, but the BAQ Designer still runs the query.
On SaaS installations, only global security managers can run the XXXChunk/XXDef tables.
If an extension table belongs to an unknown Extension set, the BAQ Designer does not run the query
and it does not save your changes. An error message displays in the Query Execution Messages
pane.
l Be careful if you decide to modify the query, as any changes impact other
applications that use this query.
l If you attempt to delete a query that is in use, a warning message displays
verifying whether you want to continue deleting it. Typically, you should not
delete any query in use unless it is obsolete or no longer needed. After you delete
the query, remove or update the dashboard, BAQ report, or other items that
previously used it.
l If several dashboards use the current query, you should not change it. Instead
create a new shared query that contains the changes you need. Other users can
then decide if they want to use your new query in their dashboards, reports, and
other items.
2. The Used - [Query ID] panel slides on. By default, the grid displays ALL items.
1. The open tabs display on a bar across the top of the BAQ Designer, just below the Crumb Bar.
4. All the tabs close except for the tab that displays the Query Identification and Query Phrase
cards.