Difference between revisions of "Tutorial/Schema cheatsheet"

From TempusServa wiki
Jump to navigation Jump to search
old>Admin
old>Admin
Line 42: Line 42:
The cube schema looks like this:
The cube schema looks like this:


<Dimension name="Example" foreignKey="PARENT">
    <Dimension name="Example" foreignKey="PARENT">
<Hierarchy hasAll="true" primaryKey="DataID" primaryKeyTable="data_parent">
        <Hierarchy hasAll="true" primaryKey="DataID" primaryKeyTable="data_parent">
<Join leftKey="GRANDPARENT" rightKey="DataID">
            <Join leftKey="GRANDPARENT" rightKey="DataID">
<Table name="data_parent"/>
                <Table name="data_parent"/>
<Table name="data_grandparent"/>
                <Table name="data_grandparent"/>
</Join>
            </Join>
<Level name="Grandparent" table="data_grandparent" column="GRANDPARENTNAME" uniqueMembers="true"/>
            <Level name="Grandparent" table="data_grandparent" column="GRANDPARENTNAME" uniqueMembers="true"/>
<Level name="Parent" table="data_parent" column="PARENTNAME" uniqueMembers="true"/>
            <Level name="Parent" table="data_parent" column="PARENTNAME" uniqueMembers="true"/>
</Hierarchy>
        </Hierarchy>
</Dimension>
    </Dimension>


=== Enumerations / groups ===
=== Enumerations / groups ===

Revision as of 02:14, 28 February 2014

Schema structure overview

  • Table (one):
    • Structure: The centre table
  • Dimensions (many)
    • Structure: Related tables or groupable values
    • OLAP: Columns/row "headers" in the cube
  • Measures (many)
    • Structure: Values in the centre table
    • OLAP: Numbers to display in cell cubes

Defining dimensions

Simple groupable values

Example:

Related table one step away

Example:


Related table TWO steps away

Descriptive fields

  • PARENTNAME
  • GRANDPARENTNAME

Keys between tables

  • PARENT
  • GRANDPARENT

Tables

  • data_parent
  • data_grandparent

The cube schema looks like this:

   <Dimension name="Example" foreignKey="PARENT">
       <Hierarchy hasAll="true" primaryKey="DataID" primaryKeyTable="data_parent">
           <Join leftKey="GRANDPARENT" rightKey="DataID">
</Join> <Level name="Grandparent" table="data_grandparent" column="GRANDPARENTNAME" uniqueMembers="true"/> <Level name="Parent" table="data_parent" column="PARENTNAME" uniqueMembers="true"/> </Hierarchy> </Dimension>

Enumerations / groups

Defining measures