zquery/V2/Request/Ristanto/daily_nop.sql

22 lines
1.4 KiB
SQL

select date
, to_char(date, 'DD-Mon') as date2
, right(yearweek, 2) as week
, to_char(date, 'YYYY') as year
, region
, level_value as nop
, sum(payload_mbyte)::numeric(100, 2) as payload_mbyte
, sum(sum_of_active_users_rnp)::numeric(100, 2) as active_users_rnp
, sum(sum_of_maximum_number_of_rrc_connection_user_unit) as maximum_number_of_rrc_connection_user
, (sum(payload_mbyte) / sum(sum_of_active_users_rnp))::numeric(100, 2) as "payload/active_users_rnp"
, (sum(payload_mbyte) / sum(sum_of_maximum_number_of_rrc_connection_user_unit))::numeric(100, 2) as "payload/maximum_number_of_rrc_connection_user"
from app.fact_category_kpi_4g_daily m
where level_type = 'NOP'
and all_band = true
and date between '2023-08-01' and date_int(1)
-- and region = 'SULAWESI'
-- and region = 'KALIMANTAN'
-- and region = 'PUMA'
group by date, right(yearweek, 2), region, level_value
order by region, level_value, date
;