Skip to content

Commit

Permalink
Remove user_id from dimension and add it as "metric" (#81)
Browse files Browse the repository at this point in the history
In essence we are going to treat user_id the same way we treat domain_sessionid_array, as we may have more than one value and this will cause unwanted extra rows.
  • Loading branch information
ilias1111 committed Oct 23, 2024
1 parent e16a2b8 commit a77519c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)) }}

)

Expand Down

0 comments on commit a77519c

Please sign in to comment.