From ba9f5144dccf7bc08910c3b24d27e84afa6f7b79 Mon Sep 17 00:00:00 2001 From: adekurniawan Date: Tue, 6 Feb 2024 11:19:14 +0700 Subject: [PATCH] update nop --- V2/Request/Ristanto/daily_nop.sql | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/V2/Request/Ristanto/daily_nop.sql b/V2/Request/Ristanto/daily_nop.sql index 8083118..f55c4d2 100644 --- a/V2/Request/Ristanto/daily_nop.sql +++ b/V2/Request/Ristanto/daily_nop.sql @@ -1,19 +1,21 @@ -select region - , level_value as nop - , date - , sum(payload_mbyte)::numeric(100, 2) as payload_mbyte - , sum(case - when region = 'PUMA' then sum_of_maximum_number_of_rrc_connection_user_unit - else maximum_number_of_rrc_connection_user_unit end) as sum_of_maximum_number_of_rrc_connection_user - , sum(sum_of_active_users_rnp)::numeric(100, 2) as sum_of_active_users_rnp - , avg(active_users_rnp)::numeric(100, 2) as active_users_rnp +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 '2022-01-01' and date_int(1) + and date between '2023-08-01' and date_int(1) -- and region = 'SULAWESI' -- and region = 'KALIMANTAN' -- and region = 'PUMA' -group by region, level_value, date -order by region, level_value, date desc -; \ No newline at end of file +group by date, right(yearweek, 2), region, level_value +order by region, level_value, date +;