Sprinkle Docs
  • What is Sprinkle?
  • Quick Start
  • Analysing your data
    • 🔭Analytics Overview
    • 💠Data Models
      • *️Variables
      • 🌲Hierarchies
      • 🤿Column Mask
    • 🎉Switch to New Reports & Dashboards
    • 🆕Reports
      • Overview
      • Build Using Tables
        • Create a new Report
        • Layout and options
        • Build and Format - Overview
        • Apply Row Limits
        • Identify Date Columns
        • Filter your data
        • Visualizations
          • Table
          • Pivot
          • Line Chart
          • Bar Chart
          • Column Chart
          • Area Chart
          • Combo Chart
          • Scatter & Bubble Plot
          • Pie Chart
          • Funnel Chart
          • Stat Card
          • Point Map
          • Heat Map
          • Radial gauge chart
        • Advanced Features
          • Custom Analysis
          • Variables
          • Table & Quick Calculations
          • Drill - Hierarchical & Date
          • Break Out
          • RLS in Table reports
          • Scheduled Exports
          • Embedding Table Reports
      • Build Using Models
        • Create a new report
        • Layout and options
        • Visualizations
        • Advanced Features
      • Build SQL Reports
        • Create a new Report
        • Layout and options
        • Writing a SQL Code on Editor
        • Visualizations
        • Variables in SQL Reports
    • 🆕Dashboards
      • 🌀Filters
      • 👆Click Behaviour
      • ⏰Data Alerts
      • 🗓️Date Drill
      • 📤Scheduled Exports
      • 🔗Embed link
      • 🖥️Dashboard layout
      • 📱Mobile Dashboards
  • Transforming your data
    • 🔰SQL Transform
    • 📓Python Notebooks
  • Integrating your data
    • ☁️Destination Warehouses
      • AWS Athena
        • Manage storage of Flow tables
      • AWS Redshift
      • Azure Synapse
      • Databricks
      • Google BigQuery
      • MySQL
      • Postgres
      • Snowflake
      • SQL Server
      • K8 Setup
        • AWS EKS
        • Google GKE
        • Azure AKS
    • ⚙️Warehouse & Storage Setup
  • Ingesting your data
    • ☄️Data Imports
      • Databases
        • Azure Cosmos DB
        • Azure Table Storage
        • Google BigQuery
        • Mongo DB
        • MySQL DB
        • Oracle DB
        • Postgres DB
        • SQL Server DB
        • Features
          • Ingestion Modes
          • Add Multiple Datasets
          • CDC Setup
            • CDC setup in Mysql
            • CDC setup in Postgres
            • CDC setup in Mongo
            • CDC setup in SQL Server
          • Destination Create Table Clause
          • SSH Tunnel Setup
      • Files
        • AWS S3
        • AWS S3 External
        • Azure Blob
        • FTP
        • Google Cloud Storage
        • Google Sheet
        • SFTP
      • Applications
        • Apple Search Ads
        • Appsflyer
        • Branch
        • Clevertap
        • Facebook Ads
        • Freshdesk
        • Freshsales
        • Google Ads
        • Google Ads V2
        • Google Analytics
        • Google Analytics 4
        • Google Analytics MCF
        • Google Search Console
        • Hubspot
        • Impact Ads
        • Intercom
        • Klaviyo
        • Leadsquared
        • LinkedIn Ads
        • Magento
        • Mailchimp
        • Marketo
        • Mixpanel
        • MoEngage
        • Rocketlane
        • Salesforce
        • SAP S4
        • Shopify
        • Snapchat Marketing
        • TikTok Ads
        • WooCommerce
        • Zendesk Chat
        • Zendesk Support
        • Zoho Analytics
        • Zoho Books
        • Zoho CRM
        • Zoho Desk
        • Zoho Invoice
        • Zoho Subscription
      • Events
        • Apache Kafka
        • AWS Kinesis
        • Azure EventHub
    • 📤File Uploads
    • 🤖API Pulls
    • 🕸️Webhooks
  • Collaborating on data
    • 📤Sharing
    • 💬Comments
    • ⚡Activity
    • 🏷️Labels
  • Managing Schedules and Data Refreshes
    • ⏱️Schedules
    • 🔔Notifications
  • User Management
    • 🔑Access Management
    • 🧑‍🤝‍🧑Groups
    • 📂Folders
    • 🔄Syncing users, groups and RLS
    • 📧Azure AD Integration
  • Data Security & Privacy
    • 🔐Security at Sprinkle
    • 📄GDPR
    • 📄Privacy Policy
  • Release Notes
    • 📢Release Notes
      • 🗒️Release Notes - v12.1 (New)
      • 🗒️Release Notes - v12.0
      • 🗒️Release Notes - v11.0
      • 🗒️Release Notes - v10.8
      • 🗒️Release Notes - v10.7
      • 🗒️Release Notes - v10.6
      • 🗒️Release Notes - v10.5
      • 🗒️Release Notes - v10.4
      • 🗒️Release Notes - v10.3
      • 🗒️Release Notes - v10.2
      • 🗒️Release Notes - v10.1
      • 🗒️Release Notes - v10.0
      • 🗒️Release Notes - v9.31
      • 🗒️Release Notes - v9.30
      • 🗒️Release Notes - v9.29
      • 🗒️Release Notes - v9.28
      • 🗒️Release Notes - v9.27
      • 🗒️Release Notes - v9.25
      • 🗒️Release Notes - v9.24
      • 🗒️Release Notes - v9.23
      • 🗒️Release Notes - v9.22
      • 🗒️Release Notes - v9.21
      • 🗒️Release Notes - v9.20
      • 🗒️Release Notes - v9.19
      • 🗒️Release Notes - v9.18
      • 🗒️Release Notes - v9.17
      • 🗒️Release Notes - v9.16
      • 🗒️Release Notes - v9.14
      • 🗒️Release Notes - v9.13
      • 🗒️Release Notes - v9.12
      • 🗒️Release Notes -v9.8
      • 🗒️Release Notes - v9.7
      • 🗒️Release Notes - v9.6
      • 🗒️Release Notes - v9.5
      • 🗒️Release Notes - v9.4
      • 🗒️Release Notes - v9.3
      • 🗒️Release Notes - v9.2
      • 🗒️Release Notes - v9.1
      • 🗒️Release Notes - v9.0 (Major)
      • 🗒️Release Notes - v7.23
      • 🗒️Release Notes - v7.21
      • 🗒️Release Notes - v7.20
      • 🗒️Release Notes - v7.15
      • 🗒️Release Notes - v7.14
      • 🗒️Release Notes - v7.13
Powered by GitBook
On this page
  • Custom columns
  • Custom metrics
  • Custom Filters
  1. Analysing your data
  2. Reports
  3. Build Using Tables
  4. Advanced Features

Custom Analysis

Some of the analysis metrics or KPIs can't be derived directly from the columns in the table or aggregate/date functions provided with them. They need to be created by writing some logic in a systematic way.

Sprinkle provides the functionality in Reports to do custom analysis by writing SQL expressions using aggregations, functions, and operators. Below we discuss different types of SQL expressions along with their examples.

Custom columns

Custom columns are SQL expressions to create new columns at the level of the input and use them in your reports/visualizations.

For example, you need to create a KPI in your report to categorize products into High value, Medium value, or Low value based on their price. You can write a SQL expression to create these categories using CASE - WHEN statements.

You can create custom columns by following below steps:

  • Click on the Custom tab in the Input pane.

  • Open the Custom Columns section and click on the '+Add Column' button.

  • In the New Custom Column pop-up, write the SQL expression for the KPI, give it a name, and enter the description for the column(optional).

  • You can use variables in your expression as well (optional).

  • Then click on the Validate button to validate the SQL expression.

  • Once validated you can create it by clicking on the Create button.

  • Then drag this Custom Column from the Input pane to the Build section of the Visualizations pane or Filters pane to use it as a filter.

  • Click on the Save/Run button.

Custom metrics

Custom metrics are SQL expressions to create complex aggregated metrics and use them in your report.

For example, you have a Region-wise Sales report, but you need to add a bifurcation of Sales done by Cash and Digital payment modes in the report. You can write SQL expressions to create two more metrics using aggregation of CASE..WHEN statements, in this case- SUM(CASE WHEN payment_mode = 'Cash' THEN sales END) or SUM(CASE WHEN payment_mode = 'Online' THEN sales END).

You can create custom metrics by following below steps:

  • Click on the Custom tab in the Input pane.

  • Open the Custom Metrics section and click on the '+Add Metric' button.

  • In the New Custom Metric pop-up, write the SQL expression for the metric, give it a name, and enter the description for the metric (optional).

  • You can use variables in your expression as well (optional).

  • Then click on the Validate button to validate the SQL expression.

  • Once validated you can create it by clicking on the Create button.

  • Then drag this Custom Metric from the Input pane to the Build section of the Visualizations pane or Filters pane to use it as a filter.

  • Click on the Save/Run button.

Custom Filters

Custom filters are SQL expressions to create complex logic that evaluates to a boolean and you can use it to filter your data.

For example, you need to filter data in your report by comparing values of two columns, you can not do that directly using normal filters. You can write an expression to compare the two columns and use it to filter the data.

You can create custom filters by following below steps:

  • Click on the Custom tab in the Input pane.

  • Open the Custom Filters section and click on the '+Add Filter' button.

  • In the New Custom Filter pop-up, write the boolean expression for the filter, give it a name, and enter the description for the filter (optional).

  • You can use variables in your expression as well (optional).

  • Then click on the Validate button to validate the SQL expression.

  • Once validated you can create it by clicking on the Create button.

  • Then drag this Custom filter from the Table pane to the Filters pane.

  • Click on the Save/Run button.

PreviousAdvanced FeaturesNextVariables

Last updated 16 days ago

🆕