13 lines
353 B
SQL
13 lines
353 B
SQL
-- dbt Gold Model: fct_spku_daily_mart
|
|||
|
|
{{ config(materialized='table', schema='gold') }}
|
||
|
|
|
||
|
|
SELECT
|
||
|
|
stasiun_id,
|
||
|
|
nama_stasiun_clean,
|
||
|
|
AVG(ispu_value) AS avg_daily_ispu,
|
||
|
|
MAX(ispu_value) AS max_daily_ispu,
|
||
|
|
COUNT(*) AS total_readings,
|
||
|
|
CURRENT_DATE AS mart_date
|
||
|
|
FROM {{ ref('stg_spku_realtime') }}
|
||
|
|
GROUP BY stasiun_id, nama_stasiun_clean
|