Skip to content

Super BI

Overview

AP and the Super BI web app allow for embedded data visualizations and business intelligence (BI) with Apache Superset integrated within DHIS2.

Apache Superset

Apache Superset is an open-source data exploration and visualization platform designed to be intuitive and highly accessible for business intelligence purposes. Superset is integrated in AP in the following ways.

  • Single Sign-On: SSO provides a seamless user experience as users can sign in once and later navigate between AP and Superset without having to log in again.
  • Datasets for views: When a user creates a view in AP, a corresponding dataset is automatically created in Superset. The dataset can be used as basis for Superset charts and dashboards.
  • Embedded dashboards: Superset dashboards can be embedded in DHIS 2 with the Super BI web app, allowing for exploration of data stored in AP from within DHIS2.

The following is an overview of the data analytics model in Apache Superset.

  • Dataset: A data table, can be physical, meaning based on a data warehouse table, or virtual, meaning based on a SQL query.
  • Chart: A visualization, such as a column chart, bar chart, line chart, bubble chart, box plot, tree map, table or pivot table.
  • Dashboard: A collection of visualizations which are organized and arranged to provide a comprehensive view of your data at a glance.

For more information about Apache Superset, consult the official documentation.

Superset dashboard

Manage embedded dashboards

The following section covers how to view, create, share and remove embedded dashboards.

Create embedded dashboard

The following describes the high-level flow for embedding a dashboard with Super BI.

  1. Create a dashboard in Apache Superset.
  2. Enable embedding for the dashboard and take note of the embed ID.
  3. Create a dashboard in Super BI and use the embed ID to embed the Superset dashboard.

The following describes the steps in more detail.

Create Superset dashboard

  1. In Apache Superset, click Dashboards.
  2. Click the + Dashboard button from the top-right corner, which will open the dashboard screen.
  3. Drag charts from the right-side bar.
  4. Click Save.

Enable embedding for Superset dashbboard

  1. Click the three-dot context menu in the top-right corner.
  2. Click Embed dashbard, which will open the embed dialog.
  3. Click Enable embedding, which will reveal an embed ID.
  4. Copy and store the embed ID.

Superset dashboard embed ID

Create Super BI dashboard

  1. In the Super BI web app for DHIS2, click the + button in the top-left corner.
  2. Enter the following information.

    Field Description
    Name The name of the dashboard (required)
    Superset embed ID The Superset embed ID previsouly retrieved from Superset (required)
    Restrict data by org unit hierarchy Whether to restrict data queries by the user data analysis org unit hierarchy
  3. Click Save.

Super BI create dashboard

Edit Super BI dashboard

  1. Click the name of the dashboard to edit in the top bar.
  2. Click Edit next to the dashboard name.
  3. Edit relevant values.
  4. Click Save.

Super BI edit dashboard

View Super BI dashboard

To view a Super BI dashboard, click the name of the dashboard in the top bar.

Super BI dashboard for immunization

Share Super BI dashboard

Super BI dashboards support the regular DHIS2 sharing access control model of DHIS2. This means that dasboards can be shared publicly, with user groups and users. View and edit permissions can be granted for each subject.

  1. Select the dashboard from the top bar.
  2. Click Share from the dashboard bar.
  3. Share the dashboard with the appropriate subjects and permissions.
  4. Click Close.

Remove Super BI dashboard

  1. Select the dashboard from the top bar.
  2. Click Delete.
  3. In the confirmation dialog, click Delete again.

Org unit hierarchy access control

Super BI allows for restricting access to data by org unit hiearchy. This is similar to the DHIS2 org unit hierarchy access control solution.

Restrict data

To restrict data queries by org unit hierarchy for a specific dashboard, select the checkbox Restrict data by org unit hierarchy in the create or edit dashboard dialog.

Access control is based on the data output and analysis org units associated with the DHIS2 user account. Access includes the sub-hierarchy of the selected org units. This means that by associating a user account in DHIS2 with one or many data output and analysis org units, access to data in Super BI will be restricted to those org units and org units in their respective sub-hierarcies.

Access control by org unit hierarchy requires that a column OrgUnitHierarchyPath is present in all datasets, including tables and views, underlying the specific dashboard. This column is available in the data tables generated by AP, such as the aggregated data value analytics table, the program enrollment analytics tables and the program event analytics tables, as well as the og unit and org unit structure metadata tables.

Access control

Access control in Super BI is based on row-level security through Superset inserting a SQL filter clause in all data queries for datasets used in the specific dashboard. The filter is on the format "OrgUnitHierarchyPath like '{user-org-unit-path}%'. The user org unit path value is a concatenation of identifiers of hierarchy ancestors of the org unit, starting wit the root org unit. For example, for an org unit with identifier qjboFI0irVu at level 4, the path value is /ImspTQPwCqd/TEQlaapDQoK/vn9KJsLyP5f/qjboFI0irVu, where the first identifier ImspTQPwCqd represents the root org unit, and the last identifier qjboFI0irVu represents the org unit itself.

By inserting a SQL like filter on OrgUnitHierarchyPath with the paths of the data output org units of the current DHIS2 user, the returned data records will be effectively limited to the org units of the sub-hierarchies of these org units. The filter is inserted into data queries by Superset at runtime.

Solution

The Super BI web app and solution in AP provides several benefits with regards to data storage, access, visualization and analytics.

  • The comprehensive data visualization capabilities of Apache Superset can be utilized within DHIS2.
  • Users can utilize their existing DHIS2 account, removing the to introduce a new set of user accounts.
  • Users will see and use a regular DHIS2 web app, minimizing the need for training.
  • Access to the Super BI web app and dashboards is controlled with regular DHIS2 user roles.
  • Data can be queried and processed directly in the high-performance AP data warehouse.
  • Data can be analyzed without having to be loaded into the DHIS2 database.
  • The DHIS2 data pipeline in AP provides near real-time access to new and update data.

Architecture

The following diagram describes the DHIS2 / Superset / AP architecture.

DHIS2 Superset architecture

Examples

This section provides examples of Super BI dashboards.

Super BI dashboard for ANC

Super BI dashboard for TB