You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just started diving in to the Activity Schema pattern and am simultaneously using this dbt-activity-schema and the ActivitySchema repo as reference.
But when trying out the dbt macros I couldn't get anything useful out using the window aggregates (activity_occurrence and activity_repeated_at). Or at least not assuming that they should reflect the ordinal ordering of events for a specific customer AND activity.
Just take the pseudo-code for these metrics from the ActivitySchema implementation specification: occurrence-columns calculation. Here the field activity is used in the partitioning.
row_number() over (partition by coalesce (activity, customer, anonymous_customer_id) order by ts asc) as activity_occurrence,
lead(ts) over (partition by coalesce (activity, customer, anonymous_customer_id) order by ts asc) as activity_repeated_at
But in this repo's implementation there is only partitioning done using customer:
# macros/activity_occurrence.sql
...
partition by coalesce (
{{ safe_cast("customer", type_string()) }},
{{ safe_cast("anonymous_customer_id", type_string()) }}
) order by ts asc ) as activity_occurrence,
...
So they contradict, and in my head I can't see the value in just having an ordinal numbering of all events for a customer. Is this diff something you did intentionally?
The text was updated successfully, but these errors were encountered:
Just started diving in to the Activity Schema pattern and am simultaneously using this dbt-activity-schema and the ActivitySchema repo as reference.
But when trying out the dbt macros I couldn't get anything useful out using the window aggregates (
activity_occurrence
andactivity_repeated_at
). Or at least not assuming that they should reflect the ordinal ordering of events for a specific customer AND activity.Just take the pseudo-code for these metrics from the ActivitySchema implementation specification: occurrence-columns calculation. Here the field
activity
is used in the partitioning.But in this repo's implementation there is only partitioning done using customer:
So they contradict, and in my head I can't see the value in just having an ordinal numbering of all events for a customer. Is this diff something you did intentionally?
The text was updated successfully, but these errors were encountered: