Skip to main content

Node Aliases

By default, Coalesce uses the source table and node name as the SQL alias when referencing data in a Node. For example:

FROM {{ ref('SAMPLE', 'ORDERS') }} "ORDERS"

This can make SQL expressions longer or harder to follow, especially when joining multiple tables. To simplify your SQL, you can assign a shorter alias, like custorders in the JOIN tab:

FROM {{ ref('SAMPLE', 'ORDERS') }} "custorders"

Adding the Alias

To use the alias properly, update the Transform field for each column.

  1. Open the Mapping tab of your Node in the Node Editor.
  2. Select all the Node columns.
  3. Go to Bulk Edit and select the Transform attribute.
  4. Enter in the alias and column. For example "custorders".{{SRC}}.
  5. Preview to make sure the change is correct.
Coalesce interface showing STG\_ORDERS\_TRANSFORM join configuration with SQL referencing the SAMPLE.ORDERS node alias o1 and transform logic in the Column Editor.

Apply SQL Functions

You can still use SQL functions such as UPPER, TRIM, or CAST with your alias. Just reference the column using the alias in the Transform field. For example:

If your alias is custorders and you want to uppercase O_ORDERSTATUS, enter this in the Transform field:

UPPER("custorders"."O_ORDERSTATUS")