Cells overview
Cells are the building blocks of life and also your canvas.
Last updated
Cells are the building blocks of life and also your canvas.
Last updated
Cells are how you query data in Count. While there are many types that look and function differently, under the hood every cell represents either a SQL select statement or Python expression that returns a table.
Python cell - type Python code directly into the cell, similarly to an IPython notebook.
Visual cell- build pivot tables or charts without code by selecting columns from your database or other cells.
Control cell - create an interactive widget that provides input parameters for other cells.
CSV cell - upload CSV files to the canvas to use as a data source for other cells.
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, the local database, or Python. 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 SQL 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.
Count's dynamic query compilation engine makes all this goodness possible. Check it out in detail here.
There are various ways to create cells in the canvas:
Via the control bar at the bottom of the canvas, or via keyboard shortcuts.
Via the buttons that appear when you hover over the edge of any existing cell. This will create a new visual, SQL or Python cell that is pre-configured to reference your starting cell.
Dragging a column from the data bar into the canvas to create a visual cell.
Importing a Jupyter notebook to create Python cells.
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 code you write. 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 additional cell-specific options for formatting, copying, selecting, and downloading data from cells. Right-click anywhere on the cell to open it.
To delete a cell, simply select it and hit the backspace key.