diff --git a/models/media_ad_views/scratch/snowplow_media_player_media_ad_views_this_run.sql b/models/media_ad_views/scratch/snowplow_media_player_media_ad_views_this_run.sql index f51c671..a31b247 100644 --- a/models/media_ad_views/scratch/snowplow_media_player_media_ad_views_this_run.sql +++ b/models/media_ad_views/scratch/snowplow_media_player_media_ad_views_this_run.sql @@ -40,7 +40,6 @@ events_this_run as ( ,ev.user_identifier ,ev.session_identifier ,ev.app_id - ,ev.user_id ,ev.play_id ,ev.media_ad_break__break_id as ad_break_id ,ev.media_ad__ad_id as ad_id @@ -58,7 +57,8 @@ events_this_run as ( {%- endif -%} {% endfor -%} {%- endif %} - + + ,max(ev.user_id) as user_id ,max(ev.media_label) as media_label ,max(ev.media_ad_break__name) as ad_break_name ,max(ev.media_ad_break__break_type) as ad_break_type @@ -81,8 +81,8 @@ events_this_run as ( ,{{ snowplow_utils.get_string_agg('original_session_identifier', 'ev', is_distinct=True) }} as domain_sessionid_array from events_this_run as ev + {{ dbt_utils.group_by(n=9+(var('snowplow__ad_views_passthroughs', [])|length)) }} - {{ dbt_utils.group_by(n=10+(var('snowplow__ad_views_passthroughs', [])|length)) }} )