@@ -44,7 +44,6 @@ WITH fct_benefits_events AS (
44
44
{{ json_extract_column(' event_properties' , ' language' ) }},
45
45
{{ json_extract_column(' event_properties' , ' origin' ) }},
46
46
{{ json_extract_column(' event_properties' , ' path' ) }},
47
- {{ json_extract_column(' event_properties' , ' payment_group' ) }},
48
47
{{ json_extract_column(' event_properties' , ' status' ) }},
49
48
{{ json_extract_column(' event_properties' , ' transit_agency' ) }},
50
49
@@ -66,6 +65,15 @@ WITH fct_benefits_events AS (
66
65
-- include the old field as well, deprecated in the mart definition
67
66
event_properties_enrollment_flows AS event_properties_eligibility_types,
68
67
68
+ -- Historical data existed in `payment_group` but new data is in `enrollment_group`
69
+ -- https://github.com/cal-itp/benefits/pull/2391
70
+ COALESCE(
71
+ {{ json_extract_flattened_column(' event_properties' , ' enrollment_group' , no_alias = true) }},
72
+ {{ json_extract_flattened_column(' event_properties' , ' payment_group' , no_alias = true) }}
73
+ ) AS event_properties_enrollment_group,
74
+ -- include the old field as well, deprecated in the mart definition
75
+ event_properties_enrollment_group AS event_properties_payment_group,
76
+
69
77
-- User Properties (https://app.amplitude.com/data/compiler/Benefits/properties/main/latest/user)
70
78
{{ json_extract_column(' user_properties' , ' eligibility_verifier' ) }},
71
79
{{ json_extract_column(' user_properties' , ' initial_referrer' ) }},
@@ -142,7 +150,8 @@ fct_old_enrollments AS (
142
150
event_properties_language,
143
151
event_properties_origin,
144
152
event_properties_path,
145
- " 5170d37b-43d5-4049-899c-b4d850e14990" as event_properties_payment_group,
153
+ " 5170d37b-43d5-4049-899c-b4d850e14990" as event_properties_enrollment_group,
154
+ event_properties_enrollment_group as event_properties_payment_group,
146
155
" success" as event_properties_status,
147
156
" Monterey-Salinas Transit" as event_properties_transit_agency,
148
157
" senior" as event_properties_enrollment_flows,
0 commit comments