Skip to content

Commit 54cfa70

Browse files
Merge pull request #8 from dschoel-pr/master
aggregation Logic for stg_facebook_ads
2 parents 14bd15b + 6911b12 commit 54cfa70

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

models/stg_facebook_ads.sql

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ with base as (
2222
cast(ad_set_id as {{ dbt_utils.type_string() }}) as ad_group_id,
2323
ad_set_name as ad_group_name,
2424
'Facebook Ads' as platform,
25-
coalesce(clicks, 0) as clicks,
26-
coalesce(impressions, 0) as impressions,
27-
coalesce(spend, 0) as spend
25+
sum(coalesce(clicks, 0)) as clicks,
26+
sum(coalesce(impressions, 0)) as impressions,
27+
sum(coalesce(spend, 0)) as spend
2828
from base
29+
{{ dbt_utils.group_by(14) }}
2930

3031

3132
)

0 commit comments

Comments
 (0)