我的做法是先在schema中定义好聚合表的相关值,如:<cube name="cube_agent_state" caption="test" encoding="UTF-8"> <Table name="fact_agent_status_fact"> <AggName name="agg_c_fact_agent_status_fact" > <AggFactCount column="fact_count"/> <AggForeignKey factColumn="time_id" aggColumn="time_id" /> <AggForeignKey factColumn="agent_no" aggColumn="agent_no" /> <AggForeignKey factColumn="agent_status" aggColumn="agent_status" /> <AggForeignKey factColumn="reason_code" aggColumn="reason_code" /> <AggMeasure name="[Measures].[times]" column="times"/> <AggMeasure name="[Measures].[length]" column="length"/> </AggName> </Table> <Dimension name="times" foreignKey="time_id" caption="时间"> <Hierarchy hasAll="true" primaryKey="time_id" > <Table name="dim_date" /> <Level name="year" column="y_id" uniqueMembers="false" type="String" levelType="TimeYears" c
找到Mondrian的配置文件mondrian.properties,修改如下几个配置项为如下值即可开启聚合表功能:
by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(防止爬虫):http://blog.liuyingguang.cn
OpenBI问答社区:http://openbi.liuyingguang.cn/
整理此文章方便大家做测试(手写Mondrian Schema自测),不必每次都向saiku上传文件了
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.firewarm</groupId>
<artifactId>testMondrian</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>testMondrian Maven Webapp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>mine</id>
<name>public Releases</name>
<layout>default</layout>
<url>http://nexus.liuyingguang.cn:8081/nexus/content/groups/public/</url>
</repository>
<repository>
<id>mine-meteorite-bi-release</id>
<