-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change daily inverter energy calculation (et/somenergia-jardiner…
…!103) Merge branch 'fix/inverter_energy' into 'main'
- Loading branch information
Showing
7 changed files
with
52 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
dbt_jardiner/models/jardiner/marts/dm_dset_energy_inverter__5m.sql
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
dbt_jardiner/models/jardiner/marts/dm_dset_energy_inverter__agg_monthly_for_om.sql
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
dbt_jardiner/models/jardiner/marts/dm_dset_energy_inverter__daily__accumulated.sql
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
dbt_jardiner/models/jardiner/marts/dm_dset_energy_inverter__monthly__reset_daily.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{ config(materialized="view") }} | ||
|
||
with | ||
inverter_energy_monthly as ( | ||
select | ||
date_trunc('month', day, 'Europe/Madrid') as month_date, | ||
plant_name, | ||
device_name, | ||
coalesce(sum(inverter_total_energy_kwh), sum(inverter_export_energy_kwh))/1000 as inverter_energy_mwh | ||
from {{ ref("int_dset_energy_inverter__daily__reset_daily") }} | ||
group by | ||
date_trunc('month', day, 'Europe/Madrid'), | ||
plant_name, | ||
device_name | ||
) | ||
select | ||
month_date as mes, | ||
plant_name as nom_planta, | ||
device_name as aparell, | ||
inverter_energy_mwh as energia_inversor_mwh | ||
from inverter_energy_monthly | ||
where month_date > '2023-12-01' | ||
order by month_date desc, plant_name, device_name |
39 changes: 0 additions & 39 deletions
39
dbt_jardiner/models/jardiner/marts/int_dset_energy_inverter__agg_hourly_for_om.sql
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters