Variable Reference (Teradata Database) - Teradata Warehouse Miner

Teradata Warehouse Miner User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.4
Published
July 2017
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
fcf1492702067123.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

This function is only available when connected to a Teradata system.

A variable defined in a Variable Creation analysis may reference another variable defined in the same analysis, provided the referenced variable does not contain dimensions. It is, however, possible to reference a generated variable that results from having a dimension applied to a variable. For example, if avg_revenue is dimensioned by Q1, Q2, Q3 and Q4, reference may be made to Q1_avg_revenue but not avg_revenue.

When referencing a variable with the same name as an input column, a runtime error occurs if a column with this name occurs in more than one table being accessed (“Column '<name>' is ambiguous”). In particular, this error occurs when an analysis with this condition is “refreshed” with a Refresh analysis, or is published with a Publish analysis and the published SQL is eventually executed by the Model Manager application. If aggregation is being performed in another variable the error “Selected non-aggregate values must be part of the associated group” may occur. In these cases, it is recommended to rename the referenced variable.

When dragging a Variable Reference operator into a variable, the following tree element is created.

Variable Creation > Input > Variables > SQL Elements Pane > Other > Variable Reference

The variable to reference is specified in the Properties panel. Double-click on Variable Reference, or highlight it and click Properties.

Variable Creation > Input > Variables > SQL Elements Pane > Other > Variable Reference Properties

Set the variable to reference in the Variable pull-down.