File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 10
10
"formatTag" : " kwh3" ,
11
11
"formatCode" : " #,##0.000\" kWh\" " ,
12
12
"valueType" : " number"
13
+ },
14
+ {
15
+ "formatTag" : " hm" ,
16
+ "formatCode" : " H:MM" ,
17
+ "valueType" : " date"
13
18
}
14
19
]
15
20
}
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ models:
30
30
description : Peak moment of the month
31
31
tests :
32
32
- not_null
33
+ - name : month_peak_timestamp_end
34
+ description : End of the peak moment of the month
35
+ tests :
36
+ - not_null
33
37
- name : month_peak_date
34
38
description : Peak moment of the month as date
35
39
tests :
Original file line number Diff line number Diff line change 1
1
with usage_data as (
2
2
select
3
3
from_timestamp,
4
+ to_timestamp,
4
5
usage
5
6
from {{ ref(' int_electricity' ) }}
6
7
),
@@ -10,6 +11,7 @@ components as (
10
11
month(u .from_timestamp ) as month,
11
12
year(u .from_timestamp ) as year,
12
13
u .from_timestamp ,
14
+ u .to_timestamp ,
13
15
u .usage * 4 as quarter_power,
14
16
dd.*
15
17
from usage_data u
@@ -34,6 +36,7 @@ with_avg as (
34
36
d .month_name_short as month_name_short,
35
37
d .month_start_date as month_start_date,
36
38
d .from_timestamp as month_peak_timestamp,
39
+ d .to_timestamp as month_peak_timestamp_end,
37
40
d .from_timestamp ::date as month_peak_date,
38
41
p .month_peak as month_peak_value,
39
42
avg (p .month_peak ) over (rows between 11 preceding and current row) as month_peak_12month_avg,
You can’t perform that action at this time.
0 commit comments