|NO.Z.00007|——————————|BigDataEnd|——|Hadoop&OLAP_Kylin.V07|——|Kylin.v07|Kylin构建Cube|4个维度构建cube|
一、创建Cube(按日期、区域、产品、渠道)
### --- Cube设计:
### --- cube执行流程
~~~ 维度:日期、渠道、区域、产品
~~~ 指标:销售总金额、订单总笔数

### --- SQL:
select t1.date1,
t2.regionid,
t2.regionname,
t3.productid,
t3.productname,
sum(t1.price) as total_money,
sum(t1.amount) as total_amount
from
dw_sales t1
inner join dim_region t2 on t1.regionid = t2.regionid
inner join dim_product t3 on t1.productid = t3.productid
group by
t1.date1,
t2.regionid,
t2.regionname,
t3.productid,
t3.productname
order by
t1.date1,
t2.regionname,
t3.productname;
二、创建cube流程
### --- 创建cube流程
~~~ 步骤:定义数据源 => 定义Model => 定义Cube => 构建Cube
三、日期、区域、产品、渠道创建cube
### --- 日期、区域、产品、渠道创建cube
~~~ 创建Model
~~~ 关联表、关联条件
~~~ 选择维度
~~~ 选择度量
~~~ settings:默认






四、创建cube
### --- 创建cube
~~~ 创建Cube:
~~~ 指定维度
~~~ 定义维度指标
~~~ 刷新设置:默认
~~~ 高级设置:默认
~~~ 覆盖设置:默认
~~~ 概述:默认——Save








五、构建cube
### --- 构建cube
~~~ 构建cube
~~~ cube构建完成


六、SQL查询
### --- 执行SQL查询语句
### --- 执行SQL查询,获取结果
select t1.date1,
t2.regionid,
t2.regionname,
t3.productid,
t3.productname,
sum(t1.price) as total_money,
sum(t1.amount) as total_amount
from
dw_sales t1
inner join dim_region t2 on t1.regionid = t2.regionid
inner join dim_product t3 on t1.productid = t3.productid
group by
t1.date1,
t2.regionid,
t2.regionname,
t3.productid,
t3.productname
order by
t1.date1,
t2.regionname,
t3.productname;

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor
浙公网安备 33010602011771号