Marple Docs
  • Introduction
  • Marple Insight
    • Welcome
      • What is Marple Insight?
      • FAQ
      • Feedback
      • Release Notes
      • Roadmap
    • Setup and Configuration
      • Data connection
        • Supported Databases
          • Azure Data Explorer (ADX)
          • Microsoft Fabric
          • TimescaleDB & PostgreSQL
          • Mireo Spacetime
          • InfluxDB (Beta)
        • Connection configuration
          • Required Queries
          • Optional Queries
          • Templating
      • Deployment
        • Infrastructure
        • Identity Providers
        • Hardware
      • API
      • Python SDK
    • User Manuals
      • Data Library
      • Visualisation
        • Add Data Sets
        • Signal List
        • Functions
        • Plot types
          • Time Series
            • Signal Settings
            • Limits and Stacking
            • Zooming
            • Cursors
            • Text data
          • Scatter
          • Map
          • Frequency (FFT)
          • Aggregates
        • Mouse Actions
        • Tabs
        • Reorganise Plots
        • Compare data
        • Realtime
        • Export image
      • Motorsport Package
      • Flight Testing Package
      • Projects
      • Sharing
      • Team and accounts
        • Workspaces
        • Account Types
      • Keyboard Shortcuts
  • Marple Files
    • Welcome
      • What is Marple Files?
      • Quick Start
      • FAQ
      • Release Notes
    • User Manuals
      • Data
        • File Types
        • Time Precision
        • Data Points
        • Upload Data
        • Organise Data
        • Influx DB
      • Visualisation
        • Overview
        • Plot types
        • Mouse & Keyboard
        • Calculated Signals
        • Overlay Data Sets
        • Projects
        • Annotations
      • Analysis
        • Metric Builder
        • SQL Editor
        • Marple AI (GPT)
      • Reporting
        • Create Reports
        • View Reports
        • Share Reports
        • From data library to reports
      • Sharing and Accounts
        • Sharing
        • Team
        • Settings
      • For developers
        • API Access Tokens
        • API Guide
        • Python
Powered by GitBook
On this page
  • Templating Language
  • Template Constants
  1. Marple Insight
  2. Setup and Configuration
  3. Data connection
  4. Connection configuration

Templating

PreviousOptional QueriesNextDeployment

Last updated 3 months ago

Templating Language

We use to construct dynamic queries, allowing flexible adjustments tailored to your data model.

Jinja allows:

  • Loops (for) → Automate query generation for multiple signals.

  • Conditions (if) → Add optional calculations dynamically.

For example, for retrieving cursor stats in ADX, we could use the following query:

{% for name, series in time_series -%}
{{series}}
| summarize
    min = min(toreal(value)),
    max = max(toreal(value)),
    mean = avg(toreal(value))
{% if extended %},
    median = percentile(toreal(value), 50),
    std = stdev(toreal(value))
{% endif %}
| extend name = '{{ name }}';

Template Constants

Marple allows you to substitute variables in query templates using Jinja syntax.

These variables fall into three categories: constants, dataset filters, and query-specific variables.

  • Constants are predefined values that can be referenced in queries as {{CONSTANT_NAME}}. You can define these constants within the configuration.

  • Dataset filters are determined by the filter signals in your dataset definition. For example, if session is part of the filter list, it can be used in queries as {{dataset.session}}.

  • Query-specific variables are defined per query and vary based on its purpose. For instance, a time series query might use {{timestamp_start}} and {{timestamp_stop}} to define the time range.

This approach ensures dynamic and flexible queries that adapt to different datasets while maintaining clarity and efficiency.

Jinja templating