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
  • Datasets: Organizing views and defining relationships
  • Dataset YAML schema
  • Why datasets matter
  • Building Dataset
  1. Count Metrics

Datasets

Datasets define the relationships between your views and their metrics.

PreviousCustomizing viewsNextCreating datasets

Last updated 1 month ago

Datasets: Organizing views and defining relationships

A dataset is a collection of views and the relationships between them, defining the structured tables that users interact with when querying data from the catalog in the canvas. Datasets should be designed to serve a business objective or function. This approach ensures that datasets are meaningful, actionable, and aligned with business needs.

Each dataset is stored in a separate YAML file and can be built using one or more views. When combining views, you must define join types (e.g., one-to-many, many-to-one) to ensure correct aggregation and maintain symmetrical data aggregation. Once configured, datasets automatically generate SQL based on predefined logic, enabling accurate and consistent data exploration within the canvas.


Dataset YAML schema

The schema for datasets definitions is displayed next to the YAML editor in Count. Expand the section below for an example dataset definition.

Show the dataset YAML schema

name: workspaces
                    
label: Workspaces

from: workspaces

description: Workspace and user summary dataset over time.

join:
  - view: integrations
    constraint: integrations.workspace_id = workspaces.workspace_id
    relationship: one_to_many

  - view: events
    constraint: events.workspace_id = workspaces.workspace_id
    relationship: one_to_many

  - view: user_permissions
    constraint: user_permissions.workspace_id = workspaces.workspace_id
    relationship: one_to_many

  - view: users
    constraint: users.user_id = user_permissions.user_id
    relationship: one_to_many

  - view: workspace_users_over_time
    constraint: workspace_users_over_time.workspace_id = workspaces.workspace_id
    relationship: one_to_many

Why datasets matter

Datasets are essential for ensuring that views are properly related and aggregated. They:

  • Maintain data integrity by defining relationships between views with appropriate join types (one_to_many, many_to_one, etc.).

  • Enable symmetric aggregation, ensuring that aggregations are consistently applied across joined views and avoid discrepancies in results.

  • Simplify querying by automatically generating SQL, reducing the need for manual writing.

  • Ensure consistency in queries and data explorations in the canvas.

Building Dataset

The next page will guide you through creating and customizing your datasets.

– Learn how to set up new datasets to organize your data effectively.

Creating
Datasets