SQL

Queries

Exploration Activity

This query returns all explorations saved in your organization. You can use these results to see which collections and reports generate the most explorations, as well as identify your organization’s top explorers.

SELECT v.id as exploration_id,
       r.name as exploration_source_report_name,
       r.collection_name as exploration_source_collection_name,
       q.name as exploration_source_query_name,
       q.connection_name,
       v.visualization_title as title,
       v.visualization_type,
       v.created_at_utc,
       v.deleted_at_utc,
       v.creator_email,
       MAX(CASE WHEN qr.state = 'succeeded' THEN qr.ended_at_utc ELSE NULL END) as exploration_source_data_last_updated
  FROM mode.organization_usage.visualizations v
  JOIN mode.organization_usage.reports r
    ON r.id = v.report_id
  JOIN mode.organization_usage.queries q
    ON q.id = v.query_id
  JOIN mode.organization_usage.query_runs qr
    ON qr.query_id = q.id
 WHERE v.is_saved_exploration = TRUE
 GROUP BY 1,2,3,4,5,6,7,8,9,10