一、定义数据源
### --- 定义数据源
~~~ 定义数据源
~~~ 加载数据
~~~ 查看加载的数据
二、定义model
### --- 定义model
~~~ 定义model
~~~ 定义分区
三、定义cube
### --- 定义cube
~~~ 定义cube
~~~ 定义维度
~~~ 措施
~~~ Refresh Setting——>后面保持默认
四、构造第三个时间段cubecube
### --- 构造第三个时间段cubecube
~~~ # 构造三个时间段cube
~~~ # 选择时间段:
~~~ 第一个cube时间段:2021-10-01~2021-10-02
~~~ 第二个cube时间段:2021-10-02~2021-10-03
~~~ 第三个cube时间段:2021-10-03~2021-10-04
~~~ # 查看构建状态
~~~ # 查看对应的Segment:查看增量构建Cube对应的Segment
五、SQL查询
### --- 执行SQL查询语句
### --- SQL查询结果
~~~ # SQL语句一:
select t1.dt,
t2.regionname,
sum(t1.price) as total_money,
sum(t1.amount) as total_amount,
max(t1.price) as total_money,
min(t1.amount) as total_amount
from dw_sales1 t1 join dim_region t2 on t1.regionid = t2.regionid group by t1.dt, t2.regionname order by dt
~~~ # SQL语句二:
select
t1.dt,
t2.regionid,
t2.regionname,
t3.productid,
t3.productname,
sum(t1.price) as total_money,
sum(t1.amount) as total_amount
from dw_sales1 t1 inner join dim_region t2 on t1.regionid = t2.regionid inner join dim_product t3 on t1.productid = t3.productid group by
t1.dt,
t2.regionid,
t2.regionname,
t3.productid,
t3.productname
order by
t1.dt,
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