Maintaining Detail Logical Tables and Detail Tables |
Overview |
A common use of a Detail Logical Table is to create it as a view to multiple, related Detail Tables. The result is that you use the Detail Logical Table as a detail data store, which can then be used as an input source for other SAS/Warehouse objects, such as an OLAP summary data store.
Note: The following explanations describe the metadata and methods used to achieve the desired results. It is assumed that the appropriate Data Warehouse Environment, Data Warehouse, Subject, and ODDs exist.
Planning the Detail Logical Table to be Organized as a Star Schema |
To illustrate how to create a Detail Logical Table as a view to multiple, related Detail Tables, this example creates a Detail Logical Table that organizes data in a star schema. A star schema is an arrangement of tables in which a large fact table has a composite, a foreign key, and is joined to several dimension tables.
For this example, the Detail Logical Table uses the toy sales data. The star schema organization is centered around sales transactions, which is joined to several dimension tables, with each dimension table having a single primary key. Toy Sales Star Schema shows the star schema organization:
Each Detail Table to be viewed by the Detail Logical Table obtains its data from a specific ODD. That is, the following ODDs exist:
For this example, the Detail Tables will be defined as follows:
Define Detail Logical Table Properties |
In the SAS/Warehouse Administrator Explorer, position the cursor on the Subject, for example Toy Sales, click the right mouse button, select Add Item, and then Detail Logical Table. In the Explorer window, a new Detail Logical Table is added under the Subject as follows:
To update the default metadata for the Detail Logical Table, position the cursor on its icon, click the right mouse button, and select Properties. The Detail Logical Table Properties window displays for you to enter the appropriate information.
General Tab |
specifies the table name Sales Detail Grp, a description, an owner, and an administrator. | ||||||||||||||
Tables Tab |
specifies the Detail Tables to be members of the Detail Logical Table, which do not exist yet. To add a table, click to display the Detail Table Properties window. Enter the name of the Detail Table, for example Customer. To finish defining the Detail Table, complete the metadata for the remaining Detail Table Properties window tabs. For a description of adding a Detail Table, see Define Detail Table Properties. After you define the Detail Table, click to add the Detail Table to the list of member tables in the Detail Logical Table. You are returned to the Tables tab in the Detail Logical Table Properties window. You would repeat these steps adding each Detail Table, which for this example, includes the following Detail Tables: | ||||||||||||||
Columns Tab |
specifies the Detail Table columns to be viewed by the Detail Logical Table, which have not been specified yet. To import columns from an input source, click to display a list of input sources, then select Detail Tables. From the Import Column Metadata window, which lists the available tables, select a table (for example, Customer) to display its available columns. Select the appropriate columns listed under Columns, which for this example are all the columns, use the double arrows to move them to Selected Columns, then click . You are returned to the Columns tab in the Detail Logical Table Properties window. Repeat the column import process for each remaining member Detail Table. Note: When implementing a star schema, the key column, which links the fact table to each dimension table, is included in both tables. You need only to import that column for the Detail Logical Table from either the fact Detail Table or the dimension Detail Table. Otherwise, you will get a dialog message indicating that a duplicate column exists and asking you to rename it. If you import a key column twice, you can cancel the rename dialog if you choose. | ||||||||||||||
Location Tab |
specifies the physical location of the view that provides interactive access to the Detail Logical Table. |
Define Process Editor Job |
In the Process Editor Job, the Detail Logical Table and all its children Detail Tables are specified in a single Job. Sales Detail Grp is specified as the output target. Each Detail Table that is a member of the Detail Logical Table is specified as input to the Detail Logical Table as well as an output target in the Job with corresponding ODDs specified as the input sources. The following Process Editor window shows the Process Flow for the Job:
Note: For this example, a single Process Editor Job is illustrated with multiple input sources and output targets. However, you could also define separate Jobs for each Detail Table and a Job for the Detail Logical Table.
The processes defined in the Job are as follows:
For more information about Process Editor Jobs, see Maintaining Jobs. For more information about processes, see Maintaining Processes.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.