Tables & References
Tables
A table represents a database table or view within the data warehouse, and each table belongs to a specific schema. Tables are created automatically when defining a data import, historization, or persisting process.
Views are created when defining a transformation. Additionally, tables can be manually created to store results of external or script transformations.
For most tables, several properties can be configured, including calculated columns, primary keys, identity columns, and indexes.
Table Properties:
- Table name: table name
- Table schema: table schema
- Table type: type of the table
- Import table: Filled by external data using SSIS package.
- Historicized table: Contains historized data. Includes:
SATZ_ID (bigint)
– surrogate primary keyDAT_VON_HIST (datetime)
– start of validityDAT_BIS_HIST (datetime)
– end of validity
- View without history
- View with history
- Persisted table without history
- Persisted table with history
- Data mart dimension view without history
- Data mart dimension view with history
- Data mart fact view without history
- Data mart fact view with history
- Externally filled table without history
- Externally filled table with history
- Data vault hub table with history
- Data vault satellite table with history
- Data vault link table with history
- Friendly name: Used in OLAP cubes instead of table name.
- Compression type: DEFAULT, NONE, ROW, PAGE
- Description: Description inherited by dependent objects.
- Hist of table: Names of persist, hub, satellite, or link tables.
- Has primary key: If checked, adds PRIMARY KEY constraint.
- Primary key name: Name of the primary key.
- PK clustered: If checked, creates clustered PK.
- Columns:
- Column name
- Data type, MaxLength, NumPrec, NumScale, Nullable
- PKOrdinalPos
- Default (e.g., GETDATE())
- Friendly name
- Referenced column (for N:1 relationships)
- References (read-only, comma-separated list)
- Identity column:
- Name, type, seed, increment
- PK pos: Position in PK
For normal tables (not views), you can optionally define identity and calculated columns (see tab).
Calculated Columns Properties:
- Column name: Name of the column
- Statement: SQL statement (macros like
@GetVaultHash
supported) - Persisted: If checked, column will be persisted
- PKOrdinalPos: Position in primary key
- Friendly name: Used in OLAP cubes instead of column name
- Referenced column: Defines N:1 references
- References: Comma-separated, read-only
Defining Table Relationships in AnalyticsCreator
Relationships between tables can be defined to enable combining tables during transformations. These relationships include N:1
("1-field" to "1-primary key field") references and more complex associations.
Defining N:1
References
One-Field to One Primary Key Field:
These references can be directly defined within the table definition using the Referenced Column attribute.
- Example: A foreign key in one table referencing the primary key of another.
More complex references can be defined using Table references.
Here is a typical table reference definition:
Table Reference Properties:
- Cardinality:
- Unknown
- OneToOne
- ManyToOne
- OneToMany
- ManyToMany
Note: It is recommended to primarily use Many-to-One (N:1) and One-to-Many (1:N) cardinalities.
- Join: SQL join type
- Table1: Schema and table name of the first table
- Table2: Schema and table name of the second table
- Alias 1: Optional. Alias of the first table. Should be defined if reference statement is used
- Alias 2: Optional. Alias of the second table. Should be defined if reference statement is used
- Description: Reference name
- Auto created: If checked, the reference was automatically created during synchronization.
- Reference statement: Optional. SQL reference statement. Should be used if the reference cannot be described using column references only. Table aliases will be used.
- Columns: There are columns and statements. Either column or statement should be defined on each reference side.
- Column1: Column from the first table
- Statement1: SQL statement
- Column2: Column from the second table
- Statement2: SQL statement
Inheritance of Table Relations Across DWH Layers
Table relations will be inherited into subsequent DWH layers. For example, if references are defined between two import tables that are historicized, the same references will be automatically created between the corresponding historicized tables.
If a reference is changed, the changes will propagate into the inherited references unless those references are used in transformations. In such cases, the references will be renamed by adding the suffix _changed(N)
, and new inherited references will be created.
Therefore, if a "parent" reference is changed, transformations using the inherited reference will not be updated automatically. However, you can manually update them by selecting the new inherited reference.
The inherited references, where the Auto created flag is set, cannot be modified unless you uncheck the Auto created flag.
Defining Relations Between Sources
Relations between sources are defined and will be inherited by the data warehouse objects during synchronization.
The N:1 relation, which refers to a "one field" to a "one primary key field" reference, can be defined directly in the source definition by using the Referenced column attribute.
For more complex references, use Source references.
Inheritance of Source Relations Across DWH Layers
Source relations will be inherited into subsequent DWH layers. For example, if references are defined between two source tables that are imported, the same references will be automatically created between the corresponding import tables.
If a source reference is changed, the changes will propagate into the inherited references, unless those references are used in transformations. In such cases, the references will be renamed by adding the suffix _changed(N)
and new inherited references will be created.
Therefore, if a "parent" reference is changed, transformations using the inherited reference will not be updated automatically. However, the user can manually update them by selecting the new inherited reference.