Joke Collection Website - Bulletin headlines - 名单转化漏斗中有几个步骤
名单转化漏斗中有几个步骤
1建表语句hive(gmall)& gt;
如果存在ads_user_convert_day,则删除表;创建外部表ads_user_convert_day(
dt字符串注释'统计日期,
uv_m_count bigint注释'当日活跃设备,
new_m_count bigint注释'当日新增设备,
new_m_ratio decimal(1,2) COMMENT '当日新增占日活的比率
)注释'转化率以' \ t '
location '/warehouse/gmall/ads/ads _ user _ convert _ day/'
2结束的行格式分隔字段数据导入
1)数据导入hive(gmall)& gt;
插入表ads _ user _ convert _ day
select
' 219-2-1 ',
sum(uc.dc) sum_dc,
sum(uc.nmc) sum_nmc,
cast(sum(UC . NMC)/sum(UC . DC)* 1 as decimal(1,2))new _ m _ ratio
from
(
select
day _ count DC,
nmc
3查看导入数据hive(gmall)& gt;
select * from ads _ user _ convert _ day;
广告层之用户行为漏斗分析
4建表语句hive(gmall)& gt;
如果存在ads_user_action_convert_day,则删除表;创建外部表ads _ user _ action _ convert _ day(
dt string COMMENT '统计日期,
total _ visitor _ m _ count bigint COMMENT '总访问人数,
order_u_count bigint COMMENT '下单人数,
访问者2order_convert_ratio decimal(1,2) COMMENT '访问到下单转化率,
payment_u_count bigint COMMENT '支付人数,
order 2 payment _ convert _ ratio decimal(1,2) COMMENT '下单到支付的转化率
)注释'用户行为漏斗分析
行格式分隔字段以' \t'
位置'/warehouse/gmall/ads/ads _ user _ action _ convert _ day/'
5数据导入
1)数据导入hive(gmall)& gt;
插入表ads _ user _ action _ convert _ day
select
' 219-2-1 ',
uv.day_count,
ua.order_count,
cast(ua . order _ count/uv . day _ count as decimal(1,2)) visitor2order_convert_ratio,
ua.payment_count,
cast(ua . payment _ count/ua . order _ count as decimal(1,2)) order2payment_convert,1,)) order_count,
sum(if(payment _ count & gt;,1,))payment _ count
from dws _ user _ action
其中dt='219-2-1'
)ua,ads_uv_count uv
其中uv.dt='219-2-1'
2)查询导入数据hive(gmall)& gt;select * from ads _ user _ action _ convert _ day;
- Previous article:Wenchuan, what’s going on now?
- Next article:How to send a circle of friends when the entertainment room opens?
- Related articles
- How to write the content of drowning prevention in winter?
- Address of Dazhou No.1 Middle and Western Campus
- Spring Festival tea gift box slogan
- Materials on the advanced deeds of outstanding college student volunteers
- How to draw the enclosure cad of building plan
- Who knows the 22 Catch-ments of Whampoa Military Academy?
- Composition on what to do in the second volume of fourth grade
- Poverty alleviation micro-film script "Relatives"
- A brief personal summary of the vice president of teaching
- What about the former site of Nanchang New Fourth Army? Are there any interesting places?