We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 14bd15b + 6911b12 commit 54cfa70Copy full SHA for 54cfa70
models/stg_facebook_ads.sql
@@ -22,10 +22,11 @@ with base as (
22
cast(ad_set_id as {{ dbt_utils.type_string() }}) as ad_group_id,
23
ad_set_name as ad_group_name,
24
'Facebook Ads' as platform,
25
- coalesce(clicks, 0) as clicks,
26
- coalesce(impressions, 0) as impressions,
27
- coalesce(spend, 0) as spend
+ sum(coalesce(clicks, 0)) as clicks,
+ sum(coalesce(impressions, 0)) as impressions,
+ sum(coalesce(spend, 0)) as spend
28
from base
29
+ {{ dbt_utils.group_by(14) }}
30
31
32
)
0 commit comments