On this page
AX2079
Specifying the primary table for an Axiom query
The Primary Table setting defines the default table for the Axiom query. In most cases, the primary table is a data table, but it does not have to be. For example, the primary table could be a reference table such as ACCT, if you wanted to generate a list of all current accounts.
The primary table affects which tables and columns can be used in other Axiom query settings. All settings must be valid in the context of the primary table. Generally speaking, you can use columns from tables other than the primary table as follows:
-
If the primary table is a data table, then you can also query data from any lookup reference tables, and from additional data tables that share at least one column with the data table.
-
If the primary table is a reference table, then you can also query data from any lookup reference tables, and from any data tables with a direct lookup to the primary table.
Columns from other tables must be specified using full Table.Column syntax. For more information, see Using multiple tables in an Axiom query.
Applying the primary table to column-only settings in the Axiom query
If any settings in the Axiom query use only a column name (instead of a fully qualified Table.Column name), then the primary table will be assumed as the table for that column. For example, if you want to bring in data from the M1 column of the GL2018 table, then you can enter either of the following into the field definition:
In this example, if the primary table is GL2018 then both entries will return the same values, because the M1 entry is interpreted as PrimaryTable.M1
(GL2018.M1
). But if the primary table is GL2017, then the M1 entry will be interpreted as GL2017.M1
instead.
However, if a column-only entry is a validated column (such as ACCT), then Axiom Software assumes the lookup table instead of the primary table. For example, an entry of ACCT will be interpreted as ACCT.ACCT
instead of GL2018.ACCT
. This is done so that the query can support pulling in data from multiple data tables that all use ACCT as a lookup table.
If you are using alias names in the field definition, you can omit the primary table setting, and Axiom Software will assume the primary table based on the entries in the field definition. This allows you to change the table that the alias names point to, without needing to update the primary table setting on the report.
When the primary table is omitted, Axiom Software assumes the primary table based on the first data column it finds in the field definition (moving from left to right for vertical queries, and top to bottom for horizontal queries). Reference table columns are ignored. The data column must be an alias name or a fully qualified Table.Column name in order to assume the primary table.
If you want to see which table is being assumed as the primary table for an Axiom query, check the Sheet Assistant. When the primary table is not explicitly defined, the assumed table name displays here in gray font and with the text (inferred) after the table name.
Axiom Software will only assume a reference table as the primary table if no data columns can be identified in the field definition (either no data columns exist, or they cannot be associated with a table).
AX2079
Get more information and training resources: www.kaufmanhall.com |
Was this topic helpful? primary_table.htm |
