Querying Our Data
Once you’ve explored and selected a dataset, you can query the data directly through the Chart Builder or SQL Lab for deeper analysis. Follow these steps to get started.
Querying with Chart Builder
The Chart Builder allows you to create queries and visualizations without writing SQL code. Here’s how:
Step 1: Select a Chart Type
Navigate to the Create Chart page by selecting a dataset.
Choose a chart type (e.g., Table) from the list of available visualizations.
Step 2: Configure Query Settings
Select Query Mode: Choose between Raw Records or Aggregate.
Choose columns to display in your chart by dragging them to the Columns section.
Add filters and ordering options as needed:
- Filters: Limit your dataset based on specific criteria (e.g., date range, category).
- Ordering: Define how the data should be sorted (e.g., descending by date).
Step 3: Create and View Chart
Set a row limit for your query (default is 100).
Click Create Chart to execute your query and preview the results.
Save the chart or modify it further as needed.
Querying with SQL Lab
For advanced users who prefer direct control over queries, the SQL Lab provides a robust interface to write SQL code.
Step 1: Open SQL Lab
From the Datasets page, select View in SQL Lab for your chosen dataset.
Alternatively, access SQL Lab from the top navigation menu under SQL.
Step 2: Check Dataset Schema
View the dataset schema to see available columns and their data types.
This helps you understand the structure of the data before writing queries.
Step 3: Write and Execute Queries
Write your SQL query in the editor (e.g.,
SELECT * FROM dataset_name WHERE column_name < value
).Click Run to execute the query and view results in the results panel.
Use features like Create Chart, Download to CSV, or Copy to Clipboard for further actions.
Next Steps
Once you’ve queried your data, explore how to Create Dashboards to visualize and share your insights.