定义时间维度时,key的定义字段,不是列名,需要是定义好的attribute名称!!!
<Dimension name='Time' table='DIM_DATE' type='TIME'
key='Date'>
<Attributes>
<Attribute name='Year' keyColumn='the_year' levelType='TimeYears' hasHierarchy='false'>
</Attribute>
<Attribute name='Quarter' levelType='TimeQuarters' hasHierarchy='false'>
<Key>
<Column name='the_year'/>
<Column name='the_quarter'/>
</Key>
<Name>
<Column name='quarter_name'/>
</Name>
</Attribute>
<Attribute name='Month' levelType='TimeMonths' hasHierarchy='false'>
<Key>
<Column name='the_year'/>
<Column name='the_month'/>
</Key>
<Name>
<Column name='month_name'/>
</Name>
</Attribute>
<Attribute name='Week' levelType='TimeWeeks' hasHierarchy='false'>
<Key>
<Column name='the_year'/>
<Column name='the_week'/>
</Key>
<Name>
<Column name='week_name'/>
</Name>
</Attribute>
<Attribute name='Day' levelType='TimeDays' hasHierarchy='false'>
<Key>
<Column name='THE_DATE'/>
</Key>
<Name>
<Column name='date_name'/>
</Name>
<OrderBy>
<Column name='THE_DATE'/>
</OrderBy>
</Attribute>
<Attribute name='Date' keyColumn='THE_DATE' hasHierarchy='false'/>
</Attributes>
<Hierarchies>
<Hierarchy name='Time' hasAll='false'>
<Level attribute='Year'>
<Annotations>
<Annotation name="AnalyzerDateFormat">[yyyy]</Annotation>
</Annotations>
</Level>
<Level attribute='Quarter'>
<Annotations>
<Annotation name="AnalyzerDateFormat">[yyyy].[Qq]</Annotation>
</Annotations>
</Level>
<Level attribute='Month'>
<Annotations>
<Annotation name="AnalyzerDateFormat">[yyyy].[Qq].[mm]</Annotation>
</Annotations>
</Level>
</Hierarchy>
<Hierarchy name='Weekly' hasAll='true'>
<Level attribute='Year'>
<Annotations>
<Annotation name="AnalyzerDateFormat">[yyyy]</Annotation>
</Annotations>
</Level>
<Level attribute='Week'>
<Annotations>
<Annotation name="AnalyzerDateFormat">[yyyy].[ww]</Annotation>
</Annotations>
</Level>
<Level attribute='Day'>
<Annotations>
<Annotation name="AnalyzerDateFormat">[yyyy].[ww].[dd]</Annotation>
</Annotations>
</Level>
</Hierarchy>
<Hierarchy name='Date Only' hasAll='true'>
<Level attribute='Date'>
<Annotations>
<Annotation name="SaikuDayFormatString">yyyy/mm/dd</Annotation>
</Annotations>
</Level>
</Hierarchy>
</Hierarchies>
</Dimension>