0.34.27
DocumentationDocumentationReferenceReferenceGuidesGuidesGitHubGitHub (opens in a new tab)ionicons-v5_logos (opens in a new tab)
  • Introduction
  • Getting started
    • Cube Core
      • Create a project
      • Query data
      • Add a pre-aggregation
      • Learn more
    • Cube Cloud and Snowflake
      • Load data
      • Connect to Snowflake
      • Create data model
      • Query from BI
      • Query from React
    • Cube Cloud and Databricks
      • Load data
      • Connect to Databricks
      • Create data model
      • Query from BI
      • Query from React
      • Upload with CLI
      • Import a GitLab repository
      • Import a GitHub repository
      • Import a Git repository
      • Import a Bitbucket repository
  • Configuration
    • Data sources
      • AWS Athena
      • AWS Redshift
      • ClickHouse
      • Databricks (JDBC)
      • Druid
      • DuckDB / MotherDuck
      • Elasticsearch
      • Firebolt
      • Google BigQuery
      • Hive / SparkSQL
      • ksqlDB
      • Materialize
      • MongoDB
      • MS SQL Server
      • MySQL
      • Oracle
      • Postgres
      • Presto
      • QuestDB
      • Snowflake
      • SQLite
      • Trino
    • Visualization tools
      • Appsmith
      • Bubble
      • Budibase
      • Deepnote
      • Delphi
      • Hex
      • Jupyter
      • LangChain
      • Metabase
      • Observable
      • Power BI
      • Retool
      • Streamlit
      • Superset / Preset
      • Tableau
      • Thoughtspot
    • VPC
      • AWS
      • Azure
      • GCP
      • Multiple Data Sources
      • Multitenancy
    • Overview
    • Concepts
      • Extending cubes
      • Polymorphic cubes
      • Data blending
      • Subquery dimensions
      • Working with joins
    • Syntax
    • Dynamic data models
      • Dynamic data models with Jinja and Python
      • Dynamic data models with JavaScript
      • Export and import
      • Execution environment (JavaScript models)
  • Caching
    • Getting started with pre-aggregations
    • Using pre-aggregations
    • Lambda pre-aggregations
    • Running in production
  • Authentication & authorization
    • Security context
  • APIs & integrations
    • SQL API
      • Authentication and Authorization
      • Joins
    • REST API
      • Query format
      • Real-Time data fetch
    • GraphQL API
    • JavaScript SDK
      • React
      • Vue
      • Angular
    • Orchestration API
      • Airflow
      • Dagster
      • Prefect
    • Playground
    • Data Model
    • Semantic Layer Sync
    • SQL Runner
    • Query History
    • Pre-Aggregations
    • Access Control
    • Budgets
    • Single Sign-On
      • Google Workspace
      • Okta
    • Development mode
    • Preferences
    • CLI
  • Deployment
    • Production checklist
    • Cube Cloud
      • Auto-suspension
      • Continuous deployment
      • Custom domains
      • Deployment types
      • Pricing
      • Limits
    • Cube Core
    • Alerts
    • Integrations
      • Datadog
      • Grafana Cloud
    • General
    • Tips and Tricks
    • Troubleshooting
    • Introduction
    • Getting started
      • Cube Core
        • Create a project
        • Query data
        • Add a pre-aggregation
        • Learn more
      • Cube Cloud and Snowflake
        • Load data
        • Connect to Snowflake
        • Create data model
        • Query from BI
        • Query from React
      • Cube Cloud and Databricks
        • Load data
        • Connect to Databricks
        • Create data model
        • Query from BI
        • Query from React
        • Upload with CLI
        • Import a GitLab repository
        • Import a GitHub repository
        • Import a Git repository
        • Import a Bitbucket repository
    • Configuration
      • Data sources
        • AWS Athena
        • AWS Redshift
        • ClickHouse
        • Databricks (JDBC)
        • Druid
        • DuckDB / MotherDuck
        • Elasticsearch
        • Firebolt
        • Google BigQuery
        • Hive / SparkSQL
        • ksqlDB
        • Materialize
        • MongoDB
        • MS SQL Server
        • MySQL
        • Oracle
        • Postgres
        • Presto
        • QuestDB
        • Snowflake
        • SQLite
        • Trino
      • Visualization tools
        • Appsmith
        • Bubble
        • Budibase
        • Deepnote
        • Delphi
        • Hex
        • Jupyter
        • LangChain
        • Metabase
        • Observable
        • Power BI
        • Retool
        • Streamlit
        • Superset / Preset
        • Tableau
        • Thoughtspot
      • VPC
        • AWS
        • Azure
        • GCP
        • Multiple Data Sources
        • Multitenancy
      • Overview
      • Concepts
        • Extending cubes
        • Polymorphic cubes
        • Data blending
        • Subquery dimensions
        • Working with joins
      • Syntax
      • Dynamic data models
        • Dynamic data models with Jinja and Python
        • Dynamic data models with JavaScript
        • Export and import
        • Execution environment (JavaScript models)
    • Caching
      • Getting started with pre-aggregations
      • Using pre-aggregations
      • Lambda pre-aggregations
      • Running in production
    • Authentication & authorization
      • Security context
    • APIs & integrations
      • SQL API
        • Authentication and Authorization
        • Joins
      • REST API
        • Query format
        • Real-Time data fetch
      • GraphQL API
      • JavaScript SDK
        • React
        • Vue
        • Angular
      • Orchestration API
        • Airflow
        • Dagster
        • Prefect
      • Playground
      • Data Model
      • Semantic Layer Sync
      • SQL Runner
      • Query History
      • Pre-Aggregations
      • Access Control
      • Budgets
      • Single Sign-On
        • Google Workspace
        • Okta
      • Development mode
      • Preferences
      • CLI
    • Deployment
      • Production checklist
      • Cube Cloud
        • Auto-suspension
        • Continuous deployment
        • Custom domains
        • Deployment types
        • Pricing
        • Limits
      • Cube Core
      • Alerts
      • Integrations
        • Datadog
        • Grafana Cloud
      • General
      • Tips and Tricks
      • Troubleshooting
      • Configuration options
      • Environment variables
      • Cubes
      • Views
      • Measures
      • Dimensions
      • Joins
      • Segments
      • Pre-aggregations
      • Types and formats
      • Context variables
      • cube
      • cube_dbt
      • lkml2cube
      • core
      • react
      • ngx
      • vue
      • ws-transport
    • REST API
    • GraphQL API
      • SQL commands
      • SQL functions and operators
    • CLI
    • Error messages
    • Using Cube with dbt
    • Recipes
        • Daily, Weekly, Monthly Active Users (DAU, WAU, MAU)
        • Implementing event analytics
        • Implementing retention analysis & cohorts
        • Implementing Funnel Analysis
        • Enforcing mandatory filters
        • Enforcing column-based access
        • Enforcing role-based access
        • Controlling access to cubes and views
        • Using different data models for tenants
        • Authenticate requests to Cube with Auth0
        • Authenticate requests to Cube with AWS Cognito
        • Working around string time dimensions
        • Using dynamic union tables
        • Implementing Entity-Attribute-Value Model (EAV)
        • Passing dynamic parameters in a query
        • Implementing data snapshots
        • Using dynamic measures
        • Calculating averages and percentiles
        • Schema Generation
        • Using multiple data sources
        • Using SSL Connections to a data source
        • Implementing pagination
        • Getting unique values for a field
        • Incrementally building pre-aggregations for a date range
        • Refreshing select partitions
        • Joining data from multiple data sources
        • Accelerating non-additive measures
        • Using originalSql and rollup pre-aggregations effectively
        • Building UI with drilldowns
        • Retrieving numeric values on the front-end
        • Migrating from Express to Docker
    • Style guide
    • Cost saving guide
Question? Give us feedback → (opens in a new tab)Edit this page
Documentation
Data modeling
Dynamic data models

Dynamic data models

Jinja & PythonJinja & Python
JavaScriptJavaScript
SyntaxDynamic data models with Jinja and Python
© 2023 Cube Dev, Inc.
ResourcesDocsBlogExamplesCommunityEventsCustomer StoriesCube Partner Network
CompanyAboutCareersTerms of UsePrivacy PolicySecurity StatementList of Subprocessors
Channels
Cube Cloud Status