Profile

Abstract

This post concludes the "Working with CGM Data" series by demonstrating how to create insightful visualizations in Tableau using continuous glucose monitor (CGM) data. It covers two visualization categories—CGM-style and data analysis-style—and highlights their unique features and applications. Advanced Tableau techniques, including calculated fields and dynamic parameters, ensure precise and actionable insights. This guide demonstrates how to translate raw CGM data into actionable visual reports, creating a framework for analyzing glucose management trends.

Key Points

  • Focus on Visualizing CGM Data: Demonstrates advanced Tableau techniques to create CGM-style and data analysis-style visualizations.
  • Categories of Visualizations:
    • CGM-Style Reports: Overview, Daily View, Comparison, Overlay, and Profile reports mimic traditional CGM reporting formats.
    • Data Analysis-Style Reports: Range and Variation, Variation by Time of Day, and experimental Time in Tight Range metrics for deeper insights.
  • Advanced Tableau Features: Includes 55 calculated fields, 7 parameters, and precision techniques such as dynamic GMI calculations for increased usability.
  • Insights Gained: Explores metrics like Time in Range, Coefficient of Variation, and glucose patterns to provide comprehensive data-driven insights.
  • Interactive Online Dashboards: Visualizations are accessible on Tableau Public for exploration and reference.
  • Not for Medical Use: Visualizations focus on data analysis and are not intended for guiding treatment decisions.

Introduction

In this final installment of the "Working with CGM Data" series, the focus shifts to creating visualizations using Tableau. This step transforms cleaned and processed continuous glucose monitor (CGM) data into meaningful insights, leveraging advanced features in Tableau for analysis and reporting. As with earlier stages of this project, the emphasis remains on clear, precise data representation rather than medical guidance.

A Dual Approach to Visualization

The visualizations in this project fall into two broad categories:

  • CGM-Style Reports: Designed as approximations of traditional CGM reporting tools like Dexcom Clarity, these visualizations provide a structured view of glucose data. While inspired by professional reports, they maintain the analytical rigor of Tableau's data aggregation methods.
  • Data Analysis-Style Reports: These charts explore glucose variability and time in range from a data analyst's point of view, offering deeper insights into glycemic patterns.

CGM-Style Reports

  • Overview: The Overview report provides a quick snapshot of glucose management, aggregating glucose readings into 15-minute intervals. This high-level view helps identify broad trends without delving into finer details.
  • Daily View: This visualization breaks down glucose fluctuations by day. Key uses include:
    • Analyzing daily patterns influenced by meals, activities, or medications.
    • Identifying recurring patterns or anomalies on specific days of the week.
  • Comparison: The Comparison report contrasts glucose data across two 14-day periods. This side-by-side view highlights:
    • The impact of changes, such as new treatments or lifestyle adjustments.
    • Progress in glucose management over time.
  • Overlay: Overlay charts display multiple days of data on a single 24-hour graph, allowing for:
    • Identification of consistent glucose patterns.
    • Exploration of variations in glucose control across several days.
  • Profile: Modeled after the Ambulatory Glucose Profile (AGP), the Profile report aggregates data from multiple days. It includes:
    • A percentile-based glucose profile (5th, 25th, 50th, 75th, and 95th percentiles).
    • Key metrics such as average glucose, glucose management indicator (GMI), and time in range.

Data Analysis-Style Reports

The data analysis visualizations now focus more clearly on the timing of glucose fluctuations, providing richer insights than previous versions.

Selectable Time in Range by Hour

These charts allow the selection of either the 70–140 mg/dL or 70–180 mg/dL range, displayed by hour of the day. This shift from a day-of-week view to an hourly breakdown adds essential context:

  • Highlights when glucose levels go out of range, such as post-meal spikes.
  • Emphasizes periods of stability, like overnight hours.
  • Avoids judgmental framing—by focusing on "when" rather than "how much," these visualizations help identify patterns without implying failure.

Coefficient of Variation by Hour

  • This updated chart presents glucose variability (CV) on an hourly basis:
  • Higher CV often aligns with lower time in range (e.g., after meals).
  • Lower CV aligns with more stable glucose control (e.g., overnight).
  • Hourly detail reinforces patterns observed in time-in-range charts.

Insights Gained

The Tableau workbook for this project contains:

  • 61 fields: Including 55 calculated fields.
  • 7 parameters: Allowing dynamic user inputs.
  • 34 worksheets: Tailored to specific analyses.
  • 9 dashboards and 1 story: Summarizing data for comprehensive reporting.

A central feature of this project is its detailed, time-specific analysis:

  • Time in range is no longer viewed at the daily or weekly level alone, but hour by hour, offering a more nuanced understanding of when glucose control is strongest and when it shifts.
  • Coefficient of Variation (CV) is also broken down by hour, showing clear alignment with time-in-range patterns—more variability during meals, more stability overnight.

The workbook also refines key calculations, such as the Glucose Management Indicator (GMI):

GMI
IF COUNTD([Date]) >= 12 AND COUNTD([Date]) <= 90 THEN
ROUND(3.31 + ([Average Glucose] * 0.02392), 1) / 100
END

Glucose Management Indicator (GMI)

GMI is a metric that estimates A1c percentage. It provides a snapshot of long-term glucose management and is calculated with 12 to 90 days of data. It serves as a valuable indicator for tracking and assessing glycemic control over time.

Why This Matters

By moving beyond generalized summaries and focusing on when changes occur, these insights support informed, data-driven exploration of CGM trends. Rather than highlighting what went wrong, the visualizations bring attention to consistent patterns—glucose stability overnight, variability after meals—empowering users to understand their data without judgment.

Visualizations at Tableau Public

Guide to Visualizations at GitHub (PDF)

Exploring Tableau Public for Data Visualization

Tableau Public is a free platform for creating, sharing, and exploring interactive visualizations online. Key features include:

  • Cost: Free for non-commercial use.
  • Data Sources: Supports Excel, CSV, JSON, and more.
  • Storage: Visualizations are saved online and publicly accessible.
  • Learning: Explore millions of public visualizations for inspiration.

For offline work, Tableau Public Desktop Edition offers:

  • Local file usage with automatic saving.
  • Drag-and-drop functionality for advanced charts and graphs.
  • Support for multiple data sources.

Despite limitations like a 15 million row cap and restricted data refresh, these are good tools for learning to create data visualizations.

Tableau Public

Tableau Public Desktop

Final Thoughts

This series demonstrates the power of integrating Python, SQLite, and Tableau to manage and analyze CGM data effectively. From building a dataset to creating actionable visualizations, each step showcases a practical approach to handling complex data with precision and clarity. While these visualizations are not intended for medical decision-making, they provide a strong foundation for understanding and exploring CGM data trends.