Skip to content

Commit

Permalink
Merge branch 'master' into new-session-id
Browse files Browse the repository at this point in the history
  • Loading branch information
tessa-beijloos authored Dec 16, 2024
2 parents 1442e39 + e8a3564 commit 6ba69ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion macros/base_select.sql
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@
WHEN event_name = 'purchase' THEN 1
ELSE 0
END AS is_purchase
{% endmacro %}
{% endmacro %}
16 changes: 16 additions & 0 deletions models/staging/base/base_ga4__events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ with source as (
{% if is_incremental() and var('end_date') is none %}
and parse_date('%Y%m%d', left(replace(_table_suffix, 'intraday_', ''), 8)) in ({{ partitions_to_replace | join(',') }})
{% endif %}
-- Add property ID filter for multiple brands
{% set selected_properties = [] %}
{% if 'all' in var('brands') %}
{% do selected_properties.extend(var('brand_properties')['all']) %}
{% else %}
{% for brand in var('brands') %}
{% do selected_properties.extend(var('brand_properties')[brand]) %}
{% endfor %}
{% endif %}
{{ log("Processing properties: " ~ selected_properties, info=True) }}
and (
{% for property_id in selected_properties %}
_table_suffix like '%{{ property_id }}'
{%- if not loop.last %} or {% endif -%}
{% endfor %}
)
),
renamed as (
select
Expand Down

0 comments on commit 6ba69ee

Please sign in to comment.