select max(tmp.province_name) from
(select bt.city_num, bt.gmv, pt.province_num, pt.province_name from business_table bt
left join province_table pt on bt.city_num = pt.city_num) tmp
GROUP BY (tmp.province_num) HAVING sum(tmp.gmv) > 500
select
count(case when tmp1.pro_gmv >=0 and tmp1.pro_gmv <500 then tmp1.pro_name else NULL END ) as gmv_0_500,
count(case when tmp1.pro_gmv >=500 and tmp1.pro_gmv <1000 then tmp1.pro_name else NULL END ) as gmv_500_1000,
count(case when tmp1.pro_gmv >=1000 then tmp1.pro_name else NULL END ) as gmv_1000_
from
(select max(tmp.province_name) as pro_name , sum(gmv) as pro_gmv from
(select bt.city_num, bt.gmv, pt.province_num, pt.province_name from business_table bt
left join province_table pt on bt.city_num = pt.city_num) tmp
group by tmp.province_num) tmp1
-- group by
select city_num, sum(gmv) as c_gmv from business_table bt group by city_num order by c_gmv
-- window
select bt.city_num, bt.c_gmv from
(select DISTINCT city_num, sum(gmv) over (PARTITION by city_num) as c_gmv from business_table) bt
order by bt.c_gmv
海盗指标法(AARRR海盗模型) 它反映了增长是系统性地贯穿于用户生命周期各个阶段的:用户拉新(Acquisition)、用户激活(Activation)、用户留存(Retention)、商业变现(Revenue)、用户推荐(Referral)
选指标常用方法是指标分级方法和OSM模型。
维度建模的模式:
维度建模步骤:
事实表种类:
维度表技术
业务数据 -- Sqoop 日志数据 -- Flume 其他数据 -- 通用第三方接口