1.3.15
DocumentationDocumentationReferenceReferenceGuidesGuidesGitHubGitHub (opens in a new tab)ionicons-v5_logos (opens in a new tab)
Try Cube for Free
  • Introduction
  • Getting started
    • 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
    • Cube Core
      • Create a project
      • Query data
      • Add a pre-aggregation
      • Learn more
      • Upload with CLI
      • Import a GitLab repository
      • Import a GitHub repository
      • Import a Git repository
      • Import a Bitbucket repository
  • Configuration
    • Data sources
      • Amazon Athena
      • Amazon Redshift
      • Apache Pinot
      • ClickHouse
      • Databricks
      • Druid
      • DuckDB / MotherDuck
      • Elasticsearch
      • Firebolt
      • Google BigQuery
      • Hive / SparkSQL
      • ksqlDB
      • Materialize
      • Microsoft Fabric
      • Microsoft SQL Server
      • MongoDB
      • MySQL
      • Oracle
      • Postgres
      • Presto
      • QuestDB
      • RisingWave
      • SingleStore
      • Snowflake
      • SQLite
      • Trino
      • Vertica
    • Visualization tools
      • Appsmith
      • Bubble
      • Budibase
      • Deepnote
      • Explo
      • Google Sheets
      • Hashboard
      • Hex
      • Hightouch
      • Jupyter
      • Klipfolio
      • LangChain
      • Looker Studio
      • Metabase
      • Microsoft Excel
      • Microsoft Power BI
      • Observable
      • Push.ai
      • Qlik Sense
      • QuickSight
      • Retool
      • RudderStack
      • Sigma
      • Steep
      • Streamlit
      • Superset / Preset
      • Tableau
      • ThoughtSpot
      • Unity Catalog
    • Multiple data sources
    • Concurrency
    • Multitenancy
    • Overview
    • Concepts
      • Calculated members
      • Multi-stage calculations
      • Extension
      • Polymorphic cubes
      • Data blending
      • 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
    • Matching pre-aggregations
    • Refreshing pre-aggregations
    • Lambda pre-aggregations
    • Running in production
  • Access control
    • Authentication
      • Name and password
      • Kerberos
      • NTLM
      • Identity provider
      • JSON Web Token
    • Security context
    • Member-level security
    • Row-level security
    • Data access policies
  • APIs & integrations
    • Queries
    • DAX API
      • Reference
    • MDX API
    • Cube Cloud for Excel
    • Cube Cloud for Sheets
    • Semantic Layer Sync
      • Apache Superset
      • Metabase
      • Preset
      • Tableau
    • SQL API
      • Query format
      • Joins
      • Authentication and Authorization
      • Reference
    • REST API
      • Query format
      • Real-Time data fetch
      • Reference
    • GraphQL API
      • Reference
    • AI API
      • Privacy and Security
      • Reference
    • JavaScript SDK
      • React
      • Vue
      • Angular
        • core
        • react
        • ngx
        • vue
        • ws-transport
    • Orchestration API
      • Airflow
      • Dagster
      • Prefect
  • Workspace
    • Playground
    • Chart Prototyping
    • Data Model
    • Visual Model
    • Rollup Designer
    • Development mode
    • Environments
    • Integrations
    • SQL Runner
    • Query History
    • Pre-aggregations
    • Performance Insights
    • Monitoring Integrations
      • Amazon CloudWatch
      • Amazon S3
      • Datadog
      • Grafana Cloud
      • New Relic
    • Access Control
    • Authentication & SSO
      • Google Workspace
      • Microsoft Entra ID
      • Okta
    • Audit Log
    • Encryption keys
    • Budgets
    • Preferences
    • CLI
      • Reference
    • AI Assistant
    • Semantic Catalog
  • Deployment
    • Production checklist
    • Cube Cloud
      • Cloud providers
        • AWS
        • GCP
        • Azure
      • Infrastructure options
      • VPC
        • AWS
          • PrivateLink
          • VPC Peering
        • GCP
        • Azure
      • BYOC
        • AWS
        • Azure
      • Deployments
      • Deployment types
      • Continuous deployment
      • Custom domains
      • Deployment warm-up
      • Auto-suspension
      • Scalability
      • Pricing
      • Support
      • Limits
    • Cube Core
  • Distribution
    • General
    • Tips and Tricks
    • Troubleshooting
    • Introduction
    • Getting started
      • 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
      • Cube Core
        • Create a project
        • Query data
        • Add a pre-aggregation
        • Learn more
        • Upload with CLI
        • Import a GitLab repository
        • Import a GitHub repository
        • Import a Git repository
        • Import a Bitbucket repository
    • Configuration
      • Data sources
        • Amazon Athena
        • Amazon Redshift
        • Apache Pinot
        • ClickHouse
        • Databricks
        • Druid
        • DuckDB / MotherDuck
        • Elasticsearch
        • Firebolt
        • Google BigQuery
        • Hive / SparkSQL
        • ksqlDB
        • Materialize
        • Microsoft Fabric
        • Microsoft SQL Server
        • MongoDB
        • MySQL
        • Oracle
        • Postgres
        • Presto
        • QuestDB
        • RisingWave
        • SingleStore
        • Snowflake
        • SQLite
        • Trino
        • Vertica
      • Visualization tools
        • Appsmith
        • Bubble
        • Budibase
        • Deepnote
        • Explo
        • Google Sheets
        • Hashboard
        • Hex
        • Hightouch
        • Jupyter
        • Klipfolio
        • LangChain
        • Looker Studio
        • Metabase
        • Microsoft Excel
        • Microsoft Power BI
        • Observable
        • Push.ai
        • Qlik Sense
        • QuickSight
        • Retool
        • RudderStack
        • Sigma
        • Steep
        • Streamlit
        • Superset / Preset
        • Tableau
        • ThoughtSpot
        • Unity Catalog
      • Multiple data sources
      • Concurrency
      • Multitenancy
      • Overview
      • Concepts
        • Calculated members
        • Multi-stage calculations
        • Extension
        • Polymorphic cubes
        • Data blending
        • 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
      • Matching pre-aggregations
      • Refreshing pre-aggregations
      • Lambda pre-aggregations
      • Running in production
    • Access control
      • Authentication
        • Name and password
        • Kerberos
        • NTLM
        • Identity provider
        • JSON Web Token
      • Security context
      • Member-level security
      • Row-level security
      • Data access policies
    • APIs & integrations
      • Queries
      • DAX API
        • Reference
      • MDX API
      • Cube Cloud for Excel
      • Cube Cloud for Sheets
      • Semantic Layer Sync
        • Apache Superset
        • Metabase
        • Preset
        • Tableau
      • SQL API
        • Query format
        • Joins
        • Authentication and Authorization
        • Reference
      • REST API
        • Query format
        • Real-Time data fetch
        • Reference
      • GraphQL API
        • Reference
      • AI API
        • Privacy and Security
        • Reference
      • JavaScript SDK
        • React
        • Vue
        • Angular
          • core
          • react
          • ngx
          • vue
          • ws-transport
      • Orchestration API
        • Airflow
        • Dagster
        • Prefect
    • Workspace
      • Playground
      • Chart Prototyping
      • Data Model
      • Visual Model
      • Rollup Designer
      • Development mode
      • Environments
      • Integrations
      • SQL Runner
      • Query History
      • Pre-aggregations
      • Performance Insights
      • Monitoring Integrations
        • Amazon CloudWatch
        • Amazon S3
        • Datadog
        • Grafana Cloud
        • New Relic
      • Access Control
      • Authentication & SSO
        • Google Workspace
        • Microsoft Entra ID
        • Okta
      • Audit Log
      • Encryption keys
      • Budgets
      • Preferences
      • CLI
        • Reference
      • AI Assistant
      • Semantic Catalog
    • Deployment
      • Production checklist
      • Cube Cloud
        • Cloud providers
          • AWS
          • GCP
          • Azure
        • Infrastructure options
        • VPC
          • AWS
            • PrivateLink
            • VPC Peering
          • GCP
          • Azure
        • BYOC
          • AWS
          • Azure
        • Deployments
        • Deployment types
        • Continuous deployment
        • Custom domains
        • Deployment warm-up
        • Auto-suspension
        • Scalability
        • Pricing
        • Support
        • Limits
      • Cube Core
    • Distribution
      • General
      • Tips and Tricks
      • Troubleshooting
      • Configuration options
      • Environment variables
      • Cubes
      • Views
      • Measures
      • Dimensions
      • Hierarchies
      • Segments
      • Joins
      • Pre-aggregations
      • Data access policies
      • Types and formats
      • Context variables
      • cube
      • cube_dbt
      • lkml2cube
    • Error messages
    • 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
        • SQL API and LDAP
        • REST API and Auth0
        • REST API and AWS Cognito
        • Calculating averages and percentiles
        • Calculating nested aggregates
        • Calculating filtered aggregates
        • Calculating period-over-period changes
        • Implementing custom time dimension granularities
        • Implementing custom calendars
        • Implementing data snapshots
        • Implementing Entity-Attribute-Value Model (EAV)
        • Passing dynamic parameters in a query
        • Using dynamic measures
        • Using dynamic union tables
        • Working around string time dimensions
        • Implementing data model generation
        • Referencing environment variables
        • Providing custom data model for each tenant
        • Using multiple data sources
        • Using SSL Connections to a data source
        • Getting unique values for a field
        • Implementing custom sorting
        • Implementing pagination
        • Accelerating non-additive measures
        • Building pre-aggregations for a date range incrementally
        • Disabling pre-aggregations
        • Using original_sql and rollup pre-aggregations effectively
        • Refreshing select partitions
        • Joining data from multiple data sources
        • Building UI with drilldowns
        • Retrieving numeric values on the front-end
        • Analyzing data from Query History export
        • Migrating from Express to Docker
    • Using Cube with dbt
    • Designing Metrics
    • 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
© 2025 Cube Dev, Inc.
ResourcesDocsBlogCommunityEventsCustomer StoriesCube Partner Network
CompanyAboutCareersTerms of UsePrivacy PolicySecurity StatementList of Subprocessors
Channels
Cube Cloud Status