AX2629

About column aliases

Each column in a table can be assigned one or more alias names. When you want to bring data from that column into an Axiom file, you can use the alias name instead of the literal column name.

Using aliases, you can point reports to new data columns without needing to change the column names in the file—instead, you can assign the alias name to a new column. Any column, including calculated fields, can be assigned to an alias name.

For example, you might want to use columns NYB1 through NYB12 of the Plan2019 table to hold next year's budget data. If you reference the columns directly in reports, then when you start a new year of planning, you would need to update the reports to point to the new columns in the new data table (Plan2020). Instead, you can define NYB1 through NYB12 as alias names for the Plan2019 table, and then reference the aliases in reports. When you are ready to start a new year of planning, you can move the aliases from the Plan2019 table to the Plan2020 table. Generally it is easier and less error prone to update the aliases for the data tables, rather than making sure you have updated every single column reference in reports.

An alias name can only be assigned to one column at a time in an Axiom Software system. For example, if the alias name of NYB1 is used in table Plan2019, you cannot also use the alias name NYB1 in any other table in that system. However, you can move the alias from one column / table to another.

The primary use case for aliases is in reports. Generally reports are designed to be used on an ongoing basis, year after year, while the templates, drivers, and plan files in a file group are designed for a specific year or cycle of planning. Therefore in most cases, you should use literal column names in file groups, so that they always point to the correct tables for their intended planning cycle.

Evaluating column names as a table column or an alias

If all alias names are unique, and do not share names with any literal column names in any tables, then every time an alias name is used, it will point to the source column for the alias. This is the recommended way to set up alias and column names. For example, if you know you plan to set up NYB1-NYB12 as alias names, then you should not use those names for any literal database columns. Instead, the database columns can be named something like P1-P12 (periods) or M1-M12 (months).

However, Axiom Software does not enforce unique naming between aliases and columns. If there is duplication between literal column names and alias names, Axiom Software determines which column to use as follows:

  1. If the name exists as a literal column in the target table, then that table column is used instead of the alias. For example, if the primary table for an Axiom query is Plan2019, and that table contains a column named NYB1, and an alias is defined in the system that is also named NYB1, Axiom Software will use Plan2019.NYB1 instead of the alias.
  2. If the name does not exist as a literal column in the target table, but it does exist as a literal column in a lookup reference table, then that table column is used instead of the alias.
  3. If 1 and 2 do not apply, then the alias column is used.