Guides
Visit our websiteDeveloper Docs
  • Getting Started with Databrain
    • What is Databrain?
  • ❄️Onboarding & Configuration
    • 📝Sign-Up
    • ✍️Sign-In
    • ✏️Google Sign In Setup for Self-hosted app
    • 🤔Forgot password? Recover your Databrain Account
    • 🌟Onboarding
    • 💾Add a Data Source
    • 🧑Configure Tenants
    • 🆕Create a Workspace
    • 🔓Create a Private Workspace
    • 🆕Create a Dashboard
    • 💠Create a Metric
      • Create Custom Columns
      • Create a Metric using Chat Mode
      • Create a Metric using Custom SQL
    • Workspace Settings
      • General Settings
      • Access Control Settings
      • Cache Settings
      • Download Settings
    • 🗄️Explore Data
  • 🛢️Datasources
    • Connecting Data Sources to Databrain
      • Amazon Redshift
      • Snowflake
      • BigQuery
      • MySQL
      • Postgres
      • MongoDB
      • ElasticSearch
      • DataBricks
      • ClickHouse
      • MSSQL
      • Amazon S3
      • CSV
      • Firebolt
      • SingleStore
      • Athena
    • Allow Access to our IP
    • Add a Data Source
    • Configure Tenants
    • How to Sync a Data Source
    • Edit Tenancy
    • Create a Datamart
    • Semantic Layer
    • Create a Data App
    • Creating a Custom Dataset/View in a Multi-Datasource Environment
  • Workspace
    • Multi Datasource Workspace
  • 🔍DASHBOARDS
    • Edit a Dashboard
    • Share Dashboard
    • Dashboard Settings
    • Create/Modify Dashboard Filter
      • Dashboard Filter - Variable Apply On
      • Add LHS and RHS custom sql support for dashboard filter
    • Customize Layout
    • Adding Elements to Dashboard
    • Import/Export Dashboard
    • Report Scheduler
  • 📉METRIC
    • Edit a Metric
    • Joins , Filter, Sort, Group By
    • Complex Filter
    • Apply Metric Filter
      • Metric Filter - Variable
      • Metric Filter - Custom
    • Switch X axis and Switch Y axis
    • Group By
    • Footnote and Long Description
    • Dynamic Property
    • Archive/Unarchive Metric Card
    • Download Metric Card
    • Download Underlying Data
    • Metric Summary
    • Metric Expression for Single Value Card
    • AI Summary
    • Merge Metrics
    • Section Filters
    • View Unpublished Metrics
  • 📊VISUALIZATIONS - ACTIONS & APPEARANCE
    • Chart Actions
      • Chart Click Action
      • Chart Click Action with Metric
      • Card Click Action
      • Drill Down
      • Cross Dashboard Drill Down
    • Chart Appearance
      • Chart-Specific Appearance Options
  • 🛢️PREVIEW OF DASHBOARDS
    • Email Settings for Scheduled Reports
    • Scheduled Reports for End User
  • 🔍FILTERS
    • Dashboard Filter
    • Metric Filter
    • App filter
  • 💡Features
    • Python Editor Console
    • Custom SQL Console
    • Custom SQL Query Guidelines
  • 🏢Integrating Plugin
    • ✳️Get an auth token
    • 🙏Get a guest token
  • 🛃THEMEING & CUSTOMIZATION
    • 🎨Creating a theme
    • 🖼️View the theme in action
    • ⚙️Reset a saved theme
  • 📊Metric Component (upto version v0.11.15)
    • ✨Quick start
  • 🕸️Web Components
    • ✨Quick start
    • ⚛️Framework Specific Guide
  • 🚀Product Changelog
  • 🤳Self Hosted Changelog
Powered by GitBook
On this page
  1. METRIC

Metric Expression for Single Value Card

This guide is essential to enhance dashboards by leveraging Metric Expressions for single-value cards.

Metric Expressions allow you to perform calculations using single-value card metrics by referencing their values with their Metric IDs.

Example:

We have two single value cards:

  • Sales with Metric ID {{Sales_hwPED}}, valued at $2.89B

  • Profit with Metric ID {{Profi_qjvSWB}}, valued at $2.84B

To calculate the Sales Profitability Ratio, we can use a Metric Expression:

  • ROUND({{Sales_hwPEDw}}/{{Profi_qjvSWB}},2)

Output: A single-value card displaying 1.02

  • Alternatively using,

{{Sales_hwPEDw}}"/"{{Profi_qjvSWB}}

Output: A single-value card displaying

2891075848.0202847 /

2840122818.152845

  1. Access Elements

Navigate to your dashboard and click on "+ Elements" button near the create metric button

  1. Configure Metric Expression

  • Enter your suitable title and description for the metric expression.

  • Choose the Element Type as "Metric Expression".

  • Select the metrics you want to include in the computation.

  • In the "Metric Expression" text box, write the formula to be applied to the chosen single-value cards.

    • Reference the value of a single-value card using its Metric ID.

      {{metricid}}

  • Customize the appearance of the single-value card using font options such as font family, font size, and font weight.

  • (Optional) Enable "Merge Card to Background" if you want to blend the metric into the dashboard background.

  • Click "Save" to complete the setup.

  1. View the Metric Expression Once saved, your Metric Expression will be displayed on the dashboard, reflecting the computed value based on the selected metrics.

Note:

Metric Expression works only for single value cards!

PreviousMetric SummaryNextAI Summary

Last updated 1 month ago

📉