ComparisonTile Documentation
Overview
The ComparisonTile is an integral component of the Vantage analytics and data platform designed to facilitate side-by-side comparisons of datasets. It enables users to visually analyze differences or similarities between two sets of data through various chart types and enhances decision-making based on comparative analytics.
Purpose
The primary purpose of the ComparisonTile is to provide an interactive interface for users to compare two datasets (Dataset A and Dataset B) against specific criteria. This tile supports features such as:
- Visualizing data through charts like bar charts or line graphs.
- Applying filters via slicers to refine comparisons based on user-selected values.
- Caching for performance improvement, optimizing repeated data fetches.
- Integration with AI capabilities to generate insights based on the comparison results.
Expected Data
The ComparisonTile expects the following data types to perform effectively:
- Data Reference IDs: Unique identifiers for the datasets to be compared.
- Workflow IDs: Identifiers for workflows connected with the datasets.
- Field mappings for custom labels and slicers.
- Selected data: Optional datasets that can override the default workflow datasets.
Settings
The following settings are available for configuring the ComparisonTile:
1. Title
- Type: String
- Description: The main title displayed at the top of the tile.
- Default Value: "Data Comparison"
2. Subtitle
- Type: String (optional)
- Description: A secondary text for additional context below the main title.
- Default Value: None
3. Data Reference IDs
- Type: Array of Strings
- Description: An array containing live data reference IDs that are used for the datasets. The first reference ID is for Dataset A, and the second (if available) is for Dataset B.
- Default Value: []
4. Workflow ID A
- Type: String
- Description: The identifier for the data workflow associated with Dataset A. This is used to fetch the primary data for comparison.
- Default Value: None
5. Workflow ID B
- Type: String
- Description: The identifier for the data workflow associated with Dataset B.
- Default Value: None (Defaults to Workflow ID A if not specified)
6. Label A
- Type: String
- Description: The display name for Dataset A within the comparison tile.
- Default Value: "Dataset A"
7. Label B
- Type: String
- Description: The display name for Dataset B. Custom labels enhance the clarity of comparisons.
- Default Value: "Dataset B"
8. Comparison Prompt
- Type: String
- Description: An optional prompt which can be used to instruct the comparison logic or provide contextual explanations within the UI.
- Default Value: None
9. Default View
- Type: String
- Description: This setting determines the initial view mode of the tile (such as summary, detailed, etc.). The choice influences how data is visually represented on first load.
- Default Value: "summary"
10. Slicer Column A
- Type: String
- Description: Specifies the column in Dataset A that serves as the slicing criterion for filtering data.
- Default Value: None
11. Slicer Column B
- Type: String
- Description: Specifies the column in Dataset B for filtering purposes.
- Default Value: None
12. Selected Data A
- Type: Object or Array
- Description: Data that is to be used as Dataset A, potentially overriding Workflow A. Supports complex data structures.
- Default Value: None
13. Selected Data B
- Type: Object or Array
- Description: Data that is to be used as Dataset B, potentially overriding Workflow B.
- Default Value: None
14. Refresh Key
- Type: Numeric
- Description: A key that allows users to forcefully refresh the data when they need updated results, impacting cached data.
- Default Value: 0
How It Works
- Initialization: When the
ComparisonTilecomponent mounts, it initializes state variables to manage data loading, errors, and comparison results. - Data Fetching: It fetches data from specified workflows or selected datasets based on provided reference IDs. The component concurrently retrieves data for both Dataset A and Dataset B.
- Caching Mechanism: It implements a session-level cache to store comparison data, thereby preventing unnecessary repeated fetch requests. Cache invalidation occurs on data changes or manual refreshes.
- Slicer Functionality: Users can apply filters via slicers on specified columns for both datasets to refine data being compared.
- Error Handling: In the event of fetching failures, appropriate errors are handled and displayed.
- Comparison Generation: Once valid datasets are available, it computes the comparison, allowing for visual rendering based on selected visualization modes.
Use Cases & Examples
Use Case 1: Sales Performance Comparison
- Scenario: A sales manager wants to compare the performance of two products over the last quarter.
- Implementation:
- Datasets: Dataset A containing sales data for Product A and Dataset B for Product B.
- Configuration:
json
{ "title": "Quarterly Sales Comparison", "workflowIdA": "salesWorkflowProductA", "workflowIdB": "salesWorkflowProductB", "labelA": "Product A", "labelB": "Product B", "defaultView": "summary", "slicerColumnA": "region", "slicerColumnB": "region" }
Use Case 2: Marketing Campaign Effectiveness
- Scenario: A marketer assesses the success of two distinct marketing campaigns.
- Implementation:
- Datasets: Dataset A includes metrics from Campaign A, while Dataset B includes metrics from Campaign B.
- Configuration:
json
{ "title": "Campaign Effectiveness Comparison", "workflowIdA": "campaignAWorkflow", "workflowIdB": "campaignBWorkflow", "labelA": "Campaign A", "labelB": "Campaign B", "defaultView": "detailed", "selectedDataA": { "conversionRates": [/*data*/] }, "selectedDataB": { "conversionRates": [/*data*/] }, "comparisonPrompt": "Compare conversion rates between two campaigns." }
Use Case 3: Inventory Analysis
- Scenario: A supply chain analyst compares inventory levels of two suppliers for the same piece of equipment.
- Implementation:
- Datasets: Dataset A for Supplier 1 and Dataset B for Supplier 2.
- Configuration:
json
{ "title": "Supplier Inventory Comparison", "workflowIdA": "supplier1InventoryWorkflow", "workflowIdB": "supplier2InventoryWorkflow", "labelA": "Supplier 1", "labelB": "Supplier 2", "slicerColumnA": "equipmentType", "slicerColumnB": "equipmentType", "defaultView": "summary" }
AI Integrations
The ComparisonTile is compatible with advanced AI features that can analyze the comparative datasets and provide insights, trends, or recommendations based on the data. These integrations can help in uncovering hidden patterns or performance metrics that aid in strategic decision-making.
Billing Impacts
Utilizing the ComparisonTile may have billing implications depending on usage:
- Data fetches: Each distinct dataset fetch, especially if sourced from workflows, could incur operational costs depending on the organization's data plan.
- AI integrations: Leveraging AI functionalities may have separate billing associated based on the usage of AI processing hours or tokens, depending on the platform's pricing model.
This comprehensive documentation provides a detailed overview useful for developers and users working with the Vantage analytics platform's ComparisonTile.