diff --git a/explores/sessions.explore.lkml b/explores/sessions.explore.lkml index 086bb96..b0e3e5f 100644 --- a/explores/sessions.explore.lkml +++ b/explores/sessions.explore.lkml @@ -15,7 +15,7 @@ explore: sessions { join: events { view_label: "Events" - sql: LEFT JOIN ${sessions.event_data} as events with offset as event_row ;; + sql: LEFT JOIN UNNEST(${sessions.event_data}) as events with offset as event_row ;; relationship: one_to_many } diff --git a/views/sessions.view.lkml b/views/sessions.view.lkml index 2f97853..a3d36a3 100644 --- a/views/sessions.view.lkml +++ b/views/sessions.view.lkml @@ -53,7 +53,7 @@ select se.session_date as session_date , d.geo__metro , d.geo__sub_continent , d.geo__region) geo_data - , (SELECT AS STRUCT se.sl_key + , (ARRAY_AGG(STRUCT( se.sl_key , se.event_rank , se.page_view_rank , se.page_view_reverse_rank @@ -80,7 +80,7 @@ select se.session_date as session_date , se.platform , se.event_dimensions , se.ecommerce - , se.items) as event_data + , se.items))) as event_data from ${session_event_packing.SQL_TABLE_NAME} as se left join ${session_tags.SQL_TABLE_NAME} as sa on se.sl_key = sa.sl_key @@ -641,4 +641,4 @@ extends: [event_funnel, page_funnel] value_format_name: percent_2 } -} \ No newline at end of file +}