15 lines
351 B
SQL
15 lines
351 B
SQL
{{ config(
|
|
materialized='table',
|
|
schema='gold'
|
|
) }}
|
|
|
|
SELECT
|
|
kecamatan,
|
|
tanggal_laporan,
|
|
COUNT(lokasi_tps) AS total_tps,
|
|
SUM(volume_sampah_m3) AS total_volume_sampah_m3,
|
|
AVG(volume_sampah_m3) AS avg_volume_per_tps_m3,
|
|
CURRENT_TIMESTAMP AS refreshed_at_gold
|
|
FROM {{ ref('silver_gws_waste_reports_clean') }}
|
|
GROUP BY 1, 2
|