LogoLogo
Platform
  • Welcome to Infinity - AI Powered Data Analytics tool.
  • Interactive Quick Start Guide
  • Comprehensive User Guide
    • 1. Connecting Your Data
      • Uploading Files as a Datasource
      • Connecting to Databases and Cloud Data Sources
      • AI-Powered Data Definition Wizard
      • Managing Data Sources
      • Supported Data Connectors
    • 2. Charts
      • Creating Charts
        • AI Chart Builder
        • Drag-Drop Builder
        • Data Explorer
      • Chart Customization
        • Chart Configuration Basics
        • Intent and Its Role in Chart Generation
        • Modifying Selected Data Sources and Tables
        • Understanding and Editing the SQL Query
        • Changing the Chart Type
        • Modifying Data Components
        • Using Pivoting for Multi-Dimensional Analysis
        • Applying Filters
        • Customizing Chart with Advanced Editor Panel
          • Styles
            • Chart Background
            • Titles
            • Legend
            • Grid
            • X-Axis
            • Y-Axis
            • Secondary Y-Axis
            • Series
          • Sharing
          • Prompts
          • JS (Code Mode)
        • Using AI Chatbot for Quick Modifications
      • Featured Chart Examples
        • Line/Bar/Column/Scatter Chart
        • Combo Chart
        • Stacked Area/Bar/Column Chart
        • 100% Stacked Column/Bar/Area Chart
        • Pie Chart
        • Metric Chart
        • Bubble Chart
        • Geo Chart
        • Geo with Makers Chart
        • Sankey Chart
        • Histogram Chart
        • Annotation Chart (ToDo)
        • Table Chart
        • Tree Map Chart
        • Timeline Chart (todo)
        • Gauge Chart (todo)
        • Custom Charts
      • Managing Charts
      • Accessing Charts
      • Chart Actions
    • 3. Storyboards
      • Creating Storyboards
      • Storyboard Customization
      • Managing Storyboards
      • Accessing Storyboards
      • Storyboard Actions
    • 4. Feed Page
    • 5. Curated Page
    • 6. Beacons: Working with Unstructured Data
      • Beacon : Basics
      • Creating Beacons
      • Accessing Beacon Data
      • Managing Beacon
    • 7. User and Access Management
      • Inviting Colleagues
      • Approving Join Requests
      • Roles
      • Orgs
      • Distribution Lists
      • Layouts
    • 8. Site Customization
    • 9. Subscriptions
      • Scheduled Emails
      • Event Based Notifications (Alerts)
      • Managing Alerts and Scheduled Emails
    • 10. Profile and settings
    • 11. Making the Most of Infinity's AI-Powered Features
    • 12. Advanced Topics
      • Chart Variables
      • Custom Computes for Event Based Subscriptions
      • Drill-down or Reference Charts
      • Custom XLS Template
      • Custom PPT Template
      • Editing the Chart JavaScript
    • 13. Getting Additional Help
      • Video Resources
      • Best Practices
      • FAQs
        • Error while creating chart
        • User not able to access Charts
        • Unable to Create a DataSource
        • Hard Reset/Reloading the browser
      • Contact Support
  • Topics to address
Powered by GitBook
On this page
  • Variables
  • Purpose of Variables
  • How to Create a Variable
  • Linked Variables
  • User Access Restrictions on Variable Values
  • Key Points to Remember
  1. Comprehensive User Guide
  2. 12. Advanced Topics

Chart Variables

Of course! Here's the documentation about Variables for your Infinity platform, formatted for GitBook:


Variables

Variables in Infinity act as dynamic parameters that can be passed to SQL queries at runtime. They allow for top-level filtering on Vectors and Storyboards, ensuring that users can filter data even before it is pulled for chart creation.

A Variable is a {name, value} tuple:

  • Name: Display name shown to the user.

  • Value: Underlying value used in SQL queries.

After creating a variable, you can reference it in a database query using a $ symbol prefix, for example, $country.

Example Usage in SQL

SELECT * FROM global_superstore_Orders WHERE Country = $country

Purpose of Variables

  • Enable dynamic filtering of data in Vectors and Storyboards.

  • Help in building queries where the value can change based on user selection.

  • Improve the flexibility and reusability of dashboards and reports.


How to Create a Variable

  1. Navigate to Settings → Site Settings → Variables.

  2. Click on Add Variable.

  3. Fill out the form:

  • Name:

    • Unique identifier for the variable.

    • Must start with a lowercase letter.

    • Only underscores (_) are allowed as special characters.

  • Label:

    • The display name visible to the users.

  • Type:

    • The data type of the variable (String, Integer, or Date).

  • Database:

    • The source database from which the {name, value} tuples are fetched.

  • Order By:

    • Query: Display order as returned by the query.

    • Most Viewed: Display based on usage/viewership.

  • Query:

    • SQL query that fetches {name, value} pairs.

    • Must be a SELECT query returning only name and value columns.

Example Variable Query

SELECT DISTINCT country_name as Name, country_code as value FROM Countries

Linked Variables

Linked Variables allow you to create dependent relationships between multiple variables. For example: Country → State → County.

In a Linked Variable:

  • Each variable remains a {name, value} pair.

  • Variables are comma-separated when created, e.g., country,state,county.

  • At query time, each variable can be referenced as $country, $state, and $county.

Example Linked Variable Query

SELECT 
  country_name AS name1, country_code AS value1,
  state AS name2, state_code AS value2,
  city_name AS name3, city_code AS value3
FROM World

User Access Restrictions on Variable Values

Infinity allows restricting variable values based on User, Role, or Distribution List (DL) access.

  • User/Role/DL columns must be included in the variable query.

  • If the User/Role/DL column is NULL, the variable value is accessible to everyone.

  • Otherwise, it must contain a comma-separated list of IDs permitted to access that value.

If the list is large, you are encouraged to create Distribution Lists (DLs) for easier management.

Example Access Control Query

WITH user_region_mappings AS (
  SELECT '2' AS user, 'West' AS region UNION ALL
  SELECT '116', 'Southeast' UNION ALL
  SELECT '20', 'Central' UNION ALL
  SELECT '71', 'Central' UNION ALL
  SELECT '71', 'Northeast'
)
SELECT
  value,
  name,
  COALESCE(STRING_AGG(user, ','), '') AS user
FROM (
  SELECT DISTINCT 
    a.region AS value,
    a.region AS name,
    b.user
  FROM file_Veeva_Komodo_ATC_Mapping a
  LEFT JOIN user_region_mappings b
  ON a.region = b.region
  WHERE a.region IS NOT NULL
) grouped
GROUP BY 1, 2

Behavior:

  • "West" is accessible only to User ID 2.

  • "Central" is accessible to User IDs 20 and 71.

  • "Great Lakes" is accessible to everyone (because User is NULL).


Key Points to Remember

  • Variable names must be unique and lowercase.

  • Variables provide dynamic SQL filtering.

  • Linked Variables allow cascading, hierarchical relationships.

  • User access can be controlled at the variable value level.


Previous12. Advanced TopicsNextCustom Computes for Event Based Subscriptions

Last updated 16 days ago