HIVE_HSQL

select from_unixtime(unix_timestamp(apply_time),'yyyyMMdd')date
,CASE WHEN apply_url like 'http://m.jia.com/page/zxjzj.html?source=jzjtusou%' then '图搜' ELSE '非图搜' end cats
,count(distinct case when apply_id is not null then apply_id else null end) apply_num
,count(distinct case when apply_mobile is not null then apply_mobile else null end) apply_user_num
,count(distinct case when need_id is not null then need_id else null end)need_num
,count(distinct case when need_mobile is not null then need_mobile else null end)need_user_num
,count(distinct case when order_id is not null then order_id else null end)order_num
,count(distinct case when order_mobile is not null then order_mobile else null end)order_user_num FROM dw.kn2_zx_apply_order_detail WHERE apply_url like 'http://m.jia.com/page/zxjzj.html%' 
and from_unixtime(unix_timestamp(apply_time),'yyyyMMdd')>='20180220'
group by from_unixtime(unix_timestamp(apply_time),'yyyyMMdd'),CASE WHEN apply_url like 'http://m.jia.com/page/zxjzj.html?source=jzjtusou%' then '图搜'ELSE '非图搜' end
ORDER BY date DESC,cats


select from_unixtime(unix_timestamp(apply_time),'yyyyMMdd')date
,CASE WHEN apply_url like 'http://m.jia.com/page/zxjzj.html?source=jzjtusou%' then '图搜' ELSE '非图搜' end cats
,count(distinct case when apply_id is not null then apply_id else null end) apply_num
,count(distinct case when apply_mobile is not null then apply_mobile else null end) apply_user_num
,count(distinct case when need_id is not null then need_id else null end)need_num
,count(distinct case when need_mobile is not null then need_mobile else null end)need_user_num
,count(distinct case when order_id is not null then order_id else null end)order_num
,count(distinct case when order_mobile is not null then order_mobile else null end)order_user_num FROM dw.kn2_zx_apply_order_detail WHERE apply_url like 'http://m.jia.com/page/zxjzj.html%' 
and from_unixtime(unix_timestamp(apply_time),'yyyyMMdd')>='20180220'
group by from_unixtime(unix_timestamp(apply_time),'yyyyMMdd'),CASE WHEN apply_url like 'http://m.jia.com/page/zxjzj.html?source=jzjtusou%' then '图搜'ELSE '非图搜' end
ORDER BY date DESC,cats



select dt,leibie,SUM(pv)pv,SUM(UV)uv FROM (select 
from_unixtime(unix_timestamp(server_time),'yyyyMMdd') dt,
CASE WHEN url LIKE '%h5.m.jia.com%' then '主app' else 'm站' end leibie ,
case when lower(url) like '%friendcircle%' then 'friendcircle'
when lower(url) like '%childcircle%' then 'childcircle'
when lower(url) like '%newcircle%' then 'newcircle'
when lower(url) like '%newtiezi%' then 'newtiezi'
when lower(url) like '%app_pinglun%' then 'app_pinglun'
when lower(url) like '%zixun/u/%' then 'person_center'else 'qita' END fenlei ,
count(1)pv,
count(distinct visitor_id)uv,ROUND(sum(residence_time)/count(distinct visitor_id),2) avg_Rtime
from dw.kn2_traf_detail
where dt>= '20180227' and (lower(url) like '%friendcircle%' 
or lower(url) like '%childcircle%' 
or lower(url) like '%newcircle%' 
or lower(url) like '%newtiezi%' 
or lower(url) like '%app_pinglun%' )
group by from_unixtime(unix_timestamp(server_time),'yyyyMMdd'),
CASE WHEN url LIKE '%h5.m.jia.com%' then '主app' else 'm站' end ,
case when lower(url) like '%friendcircle%' then 'friendcircle'
when lower(url) like '%childcircle%' then 'childcircle'
when lower(url) like '%newcircle%' then 'newcircle'
when lower(url) like '%newtiezi%' then 'newtiezi'
when lower(url) like '%app_pinglun%' then 'app_pinglun'
when lower(url) like '%zixun/u/%' then 'person_center'else 'qita' END
) A
GROUP BY A.DT,A.leibie
ORDER BY A.DT DESC ,A.leibie












select dt,'头条' as leibie,sum(pv)pv,sum(UV)uv FROM (
SELECT dt,case when page_name like '%圈子%' then '圈子' else '用户个人主页' end page_name ,COUNT(1)pv,COUNT(distinct udid)uv
FROM dw.kn1_traf_app_tracker_detail_source where DT>='20180227' -- and DT<'20180202'
and (page_name like '%圈子%'
OR page_name like '%用户个人主页%')
GROUP BY dt,page_name
ORDER BY DT desc ) A
group by a.dt
ORDER BY A.DT DESC


 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值