1、修改mondrian.properties文件
mondrian.rolap.aggregates.Read=true
mondrian.rolap.aggregates.Use=true
2、修改schema文件
修改前
<Table name="fact_user" />
修改后
<Table name="fact_user"> <AggName name="agg_lc_01_fact_user"> <AggFactCount column="user_count" /> <AggForeignKey factColumn="channel_id" aggColumn="channel_id" /> <AggMeasure column="user_count" name="[Measures].[User Count]" /> <AggLevel column="the_year" name="[Date.Monthly].[Year]" /> <AggLevel column="the_quarter" name="[Date.Monthly].[Quarter]" /> <AggLevel column="the_month" name="[Date.Monthly].[Month]" /> </AggName> </Table>
注意:AggFactCount、AggForeignKey、AggMeasure、AggLevel顺序不能错,否则会出错或无效