Count
count.co
  • Getting Started
    • What is Count?
    • Count FAQ
    • Intro to your workspace
    • Example canvases
    • Getting started guides
      • Set up your workspace and projects
        • 1. Review workspace settings
        • 2. Create and organise your projects
      • Canvas orientation
      • Your first ad hoc analysis
        • 1. Examples and templates
        • 2. Build your first queries
        • 3. Create visuals
        • 4. Caching, local cells and scheduling
        • 5. Collaborating with a stakeholder
      • Your first report
        • 1. Examples and templates
        • 2. Filters and control cells
        • 3. Sharing your report
        • 4. Alerts
  • Connect your data
    • Database connection overview
      • Athena
      • Azure Synapse
      • BigQuery
      • Databricks
      • Microsoft SQL Server
      • MySQL
      • PostgreSQL
      • Redshift
      • Snowflake
    • Refresh database schema
    • Upload CSV files
    • dbt integration
      • ☁️dbt Cloud integration
      • 👩‍💻dbt Core integration
  • Import & Export
    • Import from other tools
      • Import Miro files
      • Import SQL files
      • Import Google Sheets
      • Import Jupyter notebooks
    • Export code and results
      • Export compiled SQL and Jinja-SQL
      • Export CSV files
      • Export images and PDF files
  • THE CANVAS
    • Navigating the canvas
      • Canvas tool bar
      • Data sidebar
      • Customizing the canvas
    • Canvas objects
      • Cells
      • Text and markdown
      • Shapes and tools
      • Sticky notes
      • Frames
      • Images
      • Embeds
      • Stamps
      • Grouping objects
      • Object order and alignment
      • Locking objects
      • Scaling objects
      • Shared styles
    • Overviews
    • Templates
    • Count AI
    • Alerts and subscriptions
      • Slack integration
    • Keyboard shortcuts
  • Querying data
    • Cells overview
      • Dynamic query compilation engine
    • SQL cells
      • Referencing other cells
      • Jinja templating
      • SQL formatting
    • Python cells
    • Visual and low-code cells
      • Calculations in visuals and low-code cells
      • Joins in visuals and low-code cells
    • Control cells
      • Single and multiple selects
      • Date controls
      • Text, number, and boolean controls
      • Custom control cells
    • Local DuckDB cells
      • DuckDB on the server
    • Query caching and scheduling
    • Manage queries and results
    • Troubleshooting
  • Visualizing data
    • Visualization overview
    • Templated visuals
    • Custom visuals
      • Marks
      • Facet
      • Subplots
      • Style
      • Filters
    • Formatting a visual
      • Axes
        • Secondary Axis
      • Colors and labels
      • Legends
      • Tooltips
    • Column summaries
    • Dynamic text
    • Every Visual Under the Sun
  • Presenting and Reporting
    • Reports and Slides
  • Count Metrics
    • Intro to Count Metrics
    • Build and edit a catalog
    • Views
      • Creating views
      • Customizing views
    • Datasets
      • Creating datasets
    • Save changes to the catalog
      • Catalog validation
      • Version control
    • Exposing catalogs to the workspace
    • Caching in Count Metrics
    • Using the catalog
      • Explore from cell
  • Sharing and Permissions
    • Real-time collaboration
    • Comments
    • Sharing permissions
    • Shared links
    • Embedding canvases
  • History and Versions
    • Version control
    • Duplicating and merging
    • Data snapshots
  • Settings and administration
    • Workspace settings
      • Workspace members
      • Groups
      • Tags
      • Billing
      • Single sign-on (SSO)
        • Okta
        • Entra ID
        • JumpCloud
        • Google
        • Generic OIDC
      • Brand
    • Connection settings
    • Project settings
    • User settings
    • Roles and permissions
  • Quick guides
    • Interactive control guides
      • Date ranges
      • Date groupings
      • Search
      • Select All
  • Resources
    • Join the Slack community
  • Blog
  • Security overview
  • Terms of use
  • Pricing FAQ
Powered by GitBook
On this page
  • What are cells?
  • Cell types
  • How do cells work?
  • Working with cells
  • Creating cells
  • Naming cells
  • Cell hover menu
  • Cell context menu
  • Deleting cells
  1. Querying data

Cells overview

Cells are the building blocks of life and also your canvas.

PreviousKeyboard shortcutsNextDynamic query compilation engine

Last updated 15 days ago

What are cells?

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.

Cell types

  • - type SQL directly into the cell, using the syntax for your database (or ).

  • - type Python code directly into the cell, similarly to an IPython notebook.

  • - build pivot tables or charts without code by selecting columns from your database or other cells.

  • - create an interactive widget that provides input parameters for other cells.

  • - upload CSV files to the canvas to use as a data source for other cells.

How do cells work?

Each cell is a query

Cells reference and build upon one another

Cells are reactive

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.

SQL cells are CTEs

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.

Working with cells

Creating cells

There are various 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, SQL or Python cell that is pre-configured to reference your starting cell.

Naming 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.

Cell hover menu

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.

Cell context 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.

Deleting cells

To delete a cell, simply select it and hit the backspace key.

Each cell is a query that is sent either to your database, the , or . Count's 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 , and is indicated in the canvas with colored arrows between cells.

Count's dynamic query compilation engine makes all this goodness possible. Check it out in detail .

Via the at the bottom of the canvas, or via .

Dragging a table from the into the canvas to create a .

Dragging a column from the data bar into the canvas to create a .

to create .

local database
Python
dynamic query compilation engine
here
data bar
SQL cell
visual cell
Importing a Jupyter notebook
Python cells
SQL cell
Jinja
Python cell
Visual cell
Control cell
CSV cell
control bar
keyboard shortcuts
DAG
Under the hood, each cell is an independent SQL query.