2. Build your first queries
Now the fun begins...
1. Insert a cell
There are a few ways to insert a cell. The fastest (and my preferred method) is to drag in a column preview from the data sidebar.
For our Spotify example, let's drag in the
spotify_daily_tracks
from thespotify
schema. The query should look like:
💡 Just a reminder that our demo data runs in BigQuery, so if following along, use BigQuery syntax 😉
2. Edit the cell
We can customize this cell in a number of ways including:
Editing the query
Count can execute any SQL SELECT statement.
Queries are sent directly to your database, and results are retrieved and shown in the canvas, so use the same syntax you would in your database or SQL IDE
To run a query you can either:
click off the cell (the query will automatically run)
Shift + Enter on the keyboard
Hit the 'Run cell' button in the menu above the cell
Editing the cell
You can customize the cell name - which will be helpful when we reference it in other cells
You can add a cell title to help others understand what the cell represents
You can format the SQL in your cell using the Format SQL button in the Design bar
In our Spotify example, let's edit the name of our cell to be
daily_streams
, and we'll remove theLIMIT
so we can see all the data. Lastly, we can format our SQL to make it look pretty 😉.
3. Build a linked cell
One of the unique features of the Count canvas is the ability to reference other cells - effectively turning your analysis into a DAG of connected queries. Instead of building messy, complex queries across several tabs in a SQL IDE, visualizing your analysis as a DAG helps you to:
debug a query easily by isolating each subquery/CTE
copy and paste parts of the DAG for fast iteration and testing
the logical steps are easier to follow than trying to read messy, nested SQL
To continue our analysis, we can insert a referenced cell by clicking the </> button beneath our cell,
daily_streams
:
I'm going to build out my analysis a little bit more, just for fun!
Cell FAQs
Last updated