Skip to content

Commit

Permalink
Change array_agg logic
Browse files Browse the repository at this point in the history
  • Loading branch information
agregori97 committed Jul 12, 2024
1 parent 7e09ba7 commit 5deee82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion explores/sessions.explore.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions views/sessions.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -641,4 +641,4 @@ extends: [event_funnel, page_funnel]
value_format_name: percent_2
}

}
}

0 comments on commit 5deee82

Please sign in to comment.