Sie sind auf Seite 1von 4

Guide manual UC2

1. get VAP list

-----get VAP List insert into a temporary table


select top 1000 msisdn, sum(score)*1.000/count(*) as 'AveScore',count(*) as 'cellcount'
into nethouse.TMP_PDQ_VQP_W9
from
(select * from SDR_DYN_CEA_3V_USR_CELL_CEI_15MIN_17223
union all
select * from SDR_DYN_CEA_3V_USR_CELL_CEI_15MIN_17224
union all
select * from SDR_DYN_CEA_3V_USR_CELL_CEI_15MIN_17225
union all
select * from SDR_DYN_CEA_3V_USR_CELL_CEI_15MIN_17226
union all
select * from SDR_DYN_CEA_3V_USR_CELL_CEI_15MIN_17227
union all
select * from SDR_DYN_CEA_3V_USR_CELL_CEI_15MIN_17228
union all
select * from SDR_DYN_CEA_3V_USR_CELL_CEI_15MIN_17229) a
inner join DIM_LOC_CGISAI b on a.cgisai=b.CGISAI and b.LAYER3NAME='Lima' and b.XPOS<>0 and b.XPOS<>255000000
where msisdn in
(select h.msisdn from (
select msisdn,sum(trafficm) as 'traffic' from
(select msisdn,sum(l4_ul_throughput+l4_dw_throughput)/1024/1024 as 'Trafficm'
from ps.SDR_FLOW_SUBSCRIBER_1DAY_565 i
where dateformat(dateadd(SS,i.STARTTIME ,'1969-12-31 19:00'),'DD') >'25' and i.apn not in ('DATACE.CLARO.PE','VOIP.CLARO.PE')
group by msisdn
union all
select msisdn,sum(l4_ul_throughput+l4_dw_throughput)/1024/1024 as 'Trafficm'
from ps.SDR_FLOW_SUBSCRIBER_1DAY_566 i
where dateformat(dateadd(SS,i.STARTTIME ,'1969-12-31 19:00'),'DD') <'05' and i.apn not in ('DATACE.CLARO.PE','VOIP.CLARO.PE')
group by msisdn
)j
group by j.msisdn
having Traffic>100) h
)
group by MSISDN
having cellcount>10
order by avescore

update table name with week and daily table id


2. get all service score

update table name with week and daily table id

select d.msisdn,sum(d.AveScore) as 'AveScore',


sum(d.StreamAveScore) as 'StreamAveScore',
sum(d.WebAveScore) as 'WebAveScore',
sum(d.SNAveScore) as 'SNAveScore',
sum(d.IMAveScore) as 'IMAveScore'
from (
select msisdn,AveScore,
0 as 'StreamAveScore',
0 as 'WebAveScore',
0 as 'SNAveScore',
0 as 'IMAveScore'
from nethouse.TMP_PDQ_VQP_W3
union all
select c.msisdn,
0 as 'AveScore',
0 as 'StreamAveScore',
0 as 'WebAveScore',
0 as 'SNAveScore',
sum(indicator_1)*1.000/count(*) as 'IMAveScore'
from
(select * from SDR_DYN_CEA_3V_USR_CELL_IM_15MIN_17174
union all
select * from SDR_DYN_CEA_3V_USR_CELL_IM_15MIN_17175
union all
select * from SDR_DYN_CEA_3V_USR_CELL_IM_15MIN_17176
union all
select * from SDR_DYN_CEA_3V_USR_CELL_IM_15MIN_17177
union all
select * from SDR_DYN_CEA_3V_USR_CELL_IM_15MIN_17178
union all
select * from SDR_DYN_CEA_3V_USR_CELL_IM_15MIN_17179
union all
select * from SDR_DYN_CEA_3V_USR_CELL_IM_15MIN_17180) a
inner join DIM_LOC_CGISAI b on a.dim_53=b.CGISAI and b.LAYER3NAME='Lima' and b.XPOS<>0 and b.XPOS<>255000000
inner join nethouse.TMP_PDQ_VQP_W3 c on a.dim_52=c.msisdn
group by c.msisdn
union all
select c.msisdn,
0 as 'AveScore',
0 as 'StreamAveScore',
0 as 'WebAveScore',
sum(indicator_1)*1.000/count(*) as 'SNAveScore',
0 as 'IMAveScore'
from
(select * from SDR_DYN_CEA_3V_USR_CELL_SNS_15MIN_17174
union all
select * from SDR_DYN_CEA_3V_USR_CELL_SNS_15MIN_17175
union all
select * from SDR_DYN_CEA_3V_USR_CELL_SNS_15MIN_17176
union all
select * from SDR_DYN_CEA_3V_USR_CELL_SNS_15MIN_17177
union all
select * from SDR_DYN_CEA_3V_USR_CELL_SNS_15MIN_17178
union all
select * from SDR_DYN_CEA_3V_USR_CELL_SNS_15MIN_17179
union all
select * from SDR_DYN_CEA_3V_USR_CELL_SNS_15MIN_17180) a
inner join DIM_LOC_CGISAI b on a.dim_53=b.CGISAI and b.LAYER3NAME='Lima' and b.XPOS<>0 and b.XPOS<>255000000
inner join nethouse.TMP_PDQ_VQP_W3 c on a.dim_52=c.msisdn
group by c.msisdn
union all
select c.msisdn,
0 as 'AveScore',
0 as 'StreamAveScore',
sum(indicator_1)*1.000/count(*) as 'WebAveScore',
0 as 'SNAveScore',
0 as 'IMAveScore'
from
(select * from SDR_DYN_CEA_3V_USR_CELL_Web_15MIN_17174
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Web_15MIN_17175
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Web_15MIN_17176
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Web_15MIN_17177
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Web_15MIN_17178
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Web_15MIN_17179
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Web_15MIN_17180) a
inner join DIM_LOC_CGISAI b on a.dim_53=b.CGISAI and b.LAYER3NAME='Lima' and b.XPOS<>0 and b.XPOS<>255000000
inner join nethouse.TMP_PDQ_VQP_W3 c on a.dim_52=c.msisdn
group by c.msisdn
union all
select c.msisdn,
0 as 'AveScore',
sum(indicator_2)*1.000/count(*) as 'StreamAveScore',
0 as 'WebAveScore',
0 as 'SNAveScore',
0 as 'IMAveScore'
from
(select * from SDR_DYN_CEA_3V_USR_CELL_Stream_15MIN_17174
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Stream_15MIN_17175
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Stream_15MIN_17176
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Stream_15MIN_17177
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Stream_15MIN_17178
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Stream_15MIN_17179
union all
select * from SDR_DYN_CEA_3V_USR_CELL_Stream_15MIN_17180) a
inner join DIM_LOC_CGISAI b on a.dim_53=b.CGISAI and b.LAYER3NAME='Lima' and b.XPOS<>0 and b.XPOS<>255000000
inner join nethouse.TMP_PDQ_VQP_W3 c on a.dim_52=c.msisdn
group by c.msisdn) d
group by d.msisdn

3. select the cell and traffic data for VAP every day
//// this script is run in Hadoop
////Run this script for every in the week

create table nethouse.TMP_PDQ_VAP_PS_17180 as


select from_unixtime((BEGIN_TIME - (BEGIN_TIME % 3600)) - 5*3600, 'HH:mm') as 'MyHour',
c.cgisai,a.msisdn,b.BRAND,b.MODEL,b.TERTYPE,b.MODETYPE,c.ACCESS_TYPE,a.prot_category,a.prot_type,
sum(case when a.L4_UL_THROUGHPUT is null then 0 else L4_UL_THROUGHPUT end) as 'L4_UL_THROUGHPUT',
sum(case when a.L4_DW_THROUGHPUT is null then 0 else L4_DW_THROUGHPUT end) as 'L4_DW_THROUGHPUT',
sum(case when a.L7_UL_GOODPUT_FULL_MSS is null then 0 else L7_UL_GOODPUT_FULL_MSS end) as 'L7_UL_GOODPUT_FULL_MSS',
sum(case when a.L7_DW_GOODPUT_FULL_MSS is null then 0 else L7_DW_GOODPUT_FULL_MSS end) as 'L7_DW_GOODPUT_FULL_MSS',
sum(case when a.DATATRANS_UL_DURATION is null then 0 else DATATRANS_UL_DURATION end) as 'DATATRANS_UL_DURATION',
sum(case when a.DATATRANS_DW_DURATION is null then 0 else DATATRANS_DW_DURATION end) as 'DATATRANS_DW_DURATION',
sum(case when a.TCP_UL_RETRANS_WITHPL is null then 0 else TCP_UL_RETRANS_WITHPL end) as 'TCP_UL_RETRANS_WITHPL',
sum(case when a.TCP_DW_RETRANS_WITHPL is null then 0 else TCP_DW_RETRANS_WITHPL end) as 'TCP_DW_RETRANS_WITHPL',
sum(case when a.TCP_UL_PACKAGES_WITHPL is null then 0 else TCP_UL_PACKAGES_WITHPL end) as 'TCP_UL_PACKAGES_WITHPL',
sum(case when a.TCP_DW_PACKAGES_WITHPL is null then 0 else TCP_DW_PACKAGES_WITHPL end) as 'TCP_DW_PACKAGES_WITHPL',
sum(case when a.TCP_UL_OUTOFSEQU is null then 0 else TCP_UL_OUTOFSEQU end) as 'TCP_UL_OUTOFSEQU',
sum(case when a.TCP_DW_OUTOFSEQU is null then 0 else TCP_DW_OUTOFSEQU end) as 'TCP_DW_OUTOFSEQU',
sum(case when a.AVG_UL_RTT*a.UL_RTT_STAT_NUM is null then 0 else a.AVG_UL_RTT*a.UL_RTT_STAT_NUM end) as 'AVG_UL_RTT',
sum(case when a.AVG_DW_RTT*a.DW_RTT_STAT_NUM is null then 0 else a.AVG_DW_RTT*a.DW_RTT_STAT_NUM end) as 'AVG_DW_RTT',
sum(case when a.UL_RTT_LONG_NUM is null then 0 else UL_RTT_LONG_NUM end) as 'UL_RTT_LONG_NUM',
sum(case when a.DW_RTT_LONG_NUM is null then 0 else DW_RTT_LONG_NUM end) as 'DW_RTT_LONG_NUM',
sum(case when a.UL_RTT_STAT_NUM is null then 0 else UL_RTT_STAT_NUM end) as 'UL_RTT_STAT_NUM',
sum(case when a.DW_RTT_STAT_NUM is null then 0 else DW_RTT_STAT_NUM end) as 'DW_RTT_STAT_NUM',
sum(case when a.USER_PROBE_UL_LOST_PKT is null then 0 else USER_PROBE_UL_LOST_PKT end) as 'USER_PROBE_UL_LOST_PKT',
sum(case when a.SERVER_PROBE_UL_LOST_PKT is null then 0 else SERVER_PROBE_UL_LOST_PKT end) as 'SERVER_PROBE_UL_LOST_PKT',
sum(case when a.SERVER_PROBE_DW_LOST_PKT is null then 0 else SERVER_PROBE_DW_LOST_PKT end) as 'SERVER_PROBE_DW_LOST_PKT',
sum(case when a.USER_PROBE_DW_LOST_PKT is null then 0 else USER_PROBE_DW_LOST_PKT end) as 'USER_PROBE_DW_LOST_PKT'
from ps.DETAIL_UFDR_Other_17180 a inner join nethouse.cfg_terminal b on substr(a.imei,1,8) =b.tac
inner join nethouse.dim_loc_cgisai c on concat(a.mcc,a.mnc,a.lac,a.sac,a.ci,a.eci)=c.cgisai and c.LAYER3NAME='Lima' and c.xpos<>0
where a.msisdn in
(
'953794424',
'989379743',
'987864721',
'999100509',
'940385367',
'940791983',
.
.
.
.
.
.

)
group by MyHour,b.BRAND,b.MODEL,b.TERTYPE,b.MODETYPE,a.msisdn,c.cgisai,c.ACCESS_TYPE,a.prot_category,a.prot_type

update the table id and insert the VAP list into script

4. get VAC of the VAP


select
c.cgisai,c.cell_name,c.site_name,count(distinct msisdn) as ‘VAPCount’,count(*)/7,sum(traffic)/7 from (
select
myday,a.cgisai,a.msisdn,sum(L4_UL_THROUGHPUT+L4_DW_THROUGHPUT)/1024/1024 as 'Traffic'
from
(
select '1' as myday,* from nethouse.TMP_PDQ_VAP_PS_17181
union all
select '2' as myday, * from nethouse.TMP_PDQ_VAP_PS_17182
union all
select '3' as myday,* from nethouse.TMP_PDQ_VAP_PS_17183
union all
select '4' as myday,* from nethouse.TMP_PDQ_VAP_PS_17184
union all
select '5' as myday,* from nethouse.TMP_PDQ_VAP_PS_17185
union all
select '6' as myday,* from nethouse.TMP_PDQ_VAP_PS_17186
union all
select '7' as myday,* from nethouse.TMP_PDQ_VAP_PS_17187) a
group by myday,a.cgisai,a.msisdn) b inner join nethouse.dim_loc_cgisai c on b.cgisai=c.cgisai
group by c.cgisai,c.cell_name,c.site_name
order by VAPCount desc

Das könnte Ihnen auch gefallen