Cells are the building blocks of life and also your canvas.
Cells are how you query data in Count. While there are many types that look and function differently, under the hood every cell is a SQL select statement that returns a table.
Depending on how you want to build your query, you can choose one of the following cell types:
- Visual cell- build pivot tables or charts without code by selecting columns from your database or other cells.
- Control cell - provide input parameters for other cells via a widget. In other words, multi-select or calendar filters for example.
Understanding how cells interact with your database and other cells is critical to getting the most out of Count. Any cell in Count can pull data from either your underlying database, or from another cell.
The implications of this are really quite powerful. For example, you could build a visualization directly against your database, then write SQL against your visualization. Any cell can be the starting point for a new analysis.
Each cell is a query that is sent either to your database, or the local database. Count's dynamic query compilation engine compiles SQL at runtime.
Because cells can reference a database or another cell, they can be chained together into a linear or branching analysis. This allows you to break complex problems into easier to solve chunks. Count automatically connects related cells to one another to make data flows easy to follow - this structure is called the DAG, and is indicated in the canvas with colored arrows between cells.
Any change in a cell will automatically flow through to all downstream cells. This makes updating your analysis a seamless process, and ensures that all cell results are kept in-sync with one another.
Under the hood, each cell is a common table expression (CTE). You can view this SQL at any time by right clicking the cell and choosing 'Copy compiled SQL.' Because Count uses the syntax of your underlying database, you can port this SQL out of Count and into your database or dbt at any time.
Under the hood, each cell is an independent SQL query.
Count's dynamic query compilation engine makes all this goodness possible. Check it out in detail here.
There are four ways to create cells in the canvas:
- Via the buttons that appear when you hover over the edge of any existing cell. This will create a new visual or SQL cell that is pre-configured to reference your starting cell.
When you create a cell it will be given a default name. We strongly advise you to rename the cell to help remind yourself, and others, of what each cell represents. This is the name you will use to reference the cell in any SQL you write. And don't worry about changing a cell's name later. If you ever change a cell's name, you'll have the option to update the references in all downstream cells.
The cell hover menu contains options for viewing, formatting and exporting data from your cell. Click on a cell to select it and see the hover menu.
The cell context menu contains options for layering, locking, formatting and copying SQL from cells. Right-click anywhere on the cell to open it.
To delete a cell, simply select it and hit the backspace key.