BOOK_HIERARCHY

The BOOK_HIERARCHY table contains the multi-level book organizational structure and the desk-level information.

Column Name Type Not Null Cube Field Description
AS_OF_DATE DATE Y Timestamp (at close of business) for the data.
BOOK STRING Y Leaf node of the book hierarchy. This matches the last non-_DATAMEMBER_ node in levels 1 - 15.
HIERARCHY_LEVEL1 STRING Level 1 Node at level 1 of the book hierarchy.
HIERARCHY_LEVEL2 STRING Level 2 Node at level 2 of the book hierarchy.
HIERARCHY_LEVEL3 STRING Level 3 Node at level 3 of the book hierarchy.
HIERARCHY_LEVEL4 STRING Level 4 Node at level 4 of the book hierarchy.
HIERARCHY_LEVEL5 STRING Level 5 Node at level 5 of the book hierarchy.
HIERARCHY_LEVEL6 STRING Level 7 Node at level 6 of the book hierarchy.
HIERARCHY_LEVEL7 STRING Level 6 Node at level 7 of the book hierarchy.
HIERARCHY_LEVEL8 STRING Level 8 Node at level 8 of the book hierarchy.
HIERARCHY_LEVEL9 STRING Level 9 Node at level 9 of the book hierarchy.
HIERARCHY_LEVEL10 STRING Level 10 Node at level 10 of the book hierarchy.
HIERARCHY_LEVEL11 STRING Level 11 Node at level 11 of the book hierarchy.
HIERARCHY_LEVEL12 STRING Level 12 Node at level 12 of the book hierarchy.
HIERARCHY_LEVEL13 STRING Level 13 Node at level 13 of the book hierarchy.
HIERARCHY_LEVEL14 STRING Level 14 Node at level 14 of the book hierarchy.
HIERARCHY_LEVEL15 STRING Level 15 Node at level 15 of the book hierarchy.

Unique Key

Columns
AS_OF_DATE
BOOK

Incoming Joins

Source Table Source Columns Target Columns
TRADE_MAPPING AS_OF_DATE
BOOK
AS_OF_DATE
BOOK

Populating From a ParentChild Table

Instead of creating and populating the BOOK_HIERARCHY table directly, you can create a BOOK_PARENT_CHILD table to store the parent-child relationships.

Column Name Type Not Null Cube Field Description
NAME STRING Y Child in the parent-child relationship.
PARENT STRING Parent in the parent-child relationship. Null means the child is a root node.
DATE DATE Y Timestamp (at close of business) for the data.
With this table and the following SQL script, you can create a series of intermediate views to populate the multiple levels of the BOOK_HIERARCHY table:
Create BOOK_HIERARCHY View with SQL Script

tip

For performance reasons, views may impact query and aggregation performance.

Injecting the results of the final constructed view into a table can improve query performance. The tradeoff is that this final table will need to be manually kept up to date if the underlying parent-child tables are updated.