# Mapping indicators

How to create a Countdown or Custom mapping in the Data Extractor, match each indicator to the DHIS2 data elements, indicators or data sets behind it, and share mappings.

A **mapping** says which DHIS2 data make up each indicator you download: for example, that "ANC 1st visit" is the sum
of two data elements of the antenatal care form. You make it once per server, after [signing in](https://datasuite.damurka.com/en/apps/data-extractor/dhis2-login.md),
and reuse it for every [download](https://datasuite.damurka.com/en/apps/data-extractor/data-download.md). For the Countdown analysis, create a
**Countdown** mapping: its workbook is the one the RMNCAH and Vaxx apps load.

**Before you start:** connect to your DHIS2 server and let the metadata copy finish
([DHIS2 login](https://datasuite.damurka.com/en/apps/data-extractor/dhis2-login.md)).

![Mappings: each mapping with its kind, its indicators and how many are mapped](https://datasuite.damurka.com/images/extractor-mappings.png)

## Creating a mapping

```mermaid
flowchart TD
  A["New mapping"] --> B{"What kind of mapping?"}
  B -- "Countdown" --> C["Every Countdown indicator, fixed"]
  B -- "Custom" --> D["Add indicator, name it, choose its sheet"]
  C --> E["Find sources: Add"]
  D --> E
  C -. "no data on the server" .-> N["Can't be mapped: Mark as not available"]:::optional
  E --> F["Save mapping"]:::done
  N --> F
```

### 1. Click **New mapping**

On **Mappings** (or on the **Overview** of a new connection), click **New mapping**.

<a id="map-metadata"></a>

### 2. Choose the kind

- **Countdown** starts from the Countdown 2030 indicator list. The indicators are fixed: you match each one to the data
  on your server. Its downloads come in the parts the Countdown apps read: population, reporting completeness and
  services (and the health system figures).
- **Custom** starts empty. You name your own indicators and choose the data behind each: for programme reviews, other
  health programmes and one-off analyses.

The kind cannot be changed later. Click **Next**.

![What kind of mapping? Countdown or Custom](https://datasuite.damurka.com/images/extractor-new-mapping.png)

### 3. Name it

Give the mapping a **Name** and, if you like, a **Description**. The name is shown in **Mappings** and **New
download** and used in file names; a Countdown mapping is named after the server to begin with. Click **Create
mapping**: the mapping editor opens.

### 4. Match the indicators, then save

Select an indicator on the left, search for its data under **Find sources** on the right and click **Add** (details
below). When you are done, click **Save mapping**. **Discard** leaves without saving.

## The mapping editor

The editor has three columns: the indicators, the selected indicator, and **Find sources**. The header counts how
many indicators are mapped; **Sheets in the Excel download** shows how the workbook will be organised.

### A Countdown mapping

![The editor of a Countdown mapping: the indicators by part, the selected indicator, and a search for its sources](https://datasuite.damurka.com/images/extractor-mapping-countdown.png)

- The indicators are grouped by part, one sheet of the workbook each: **Population** (yearly), **Reporting
  completeness** (monthly), **Services** (monthly) and **Admin** (one value per unit, the health system figures). The
  sheets are set by Countdown 2030 and can't be changed.
- Countdown sets each indicator's name and meaning; you choose which data on your server feed it. **Not mapped** in
  the filter shows only those still to do, and **Next not mapped** jumps to the next one.
- If the server has no data for an indicator, click **Can't be mapped…**, choose why (**Not collected**, **No
  matching data** or **Other reason**), add a note if useful and click **Mark as not available**. It then counts as
  done, and the workbook keeps its column, empty. **Map it instead** undoes this.
- An indicator that is neither mapped nor marked as not available is left out of downloads until you map it.

### A Custom mapping

![The editor of a Custom mapping: indicators on two sheets, a source with its disaggregations, and the search](https://datasuite.damurka.com/images/extractor-mapping-custom.png)

- **Add indicator** adds one. Give it an **Indicator name**; **Column in the download** follows the name until you
  change it; **Sheet in the download** chooses its sheet.
- **Add sheet** adds a sheet (each sheet becomes a sheet of the workbook); the pencil renames it. **Group by data set**
  puts each indicator on a sheet named after the data set of its first source.
- Drag indicators on the left to change the column order. **Delete indicator** removes the selected one.

### Finding and adding sources

- Type part of a name, a code or a form number under **Find sources**. The results are split into **Data elements**,
  **Indicators** and **Data sets**; click **Add**.
- **A data element**: by default all its disaggregations (category option combinations) count. Click **Edit** on the
  source to choose them under **Which disaggregations count?** (**Include all**, **Exclude all**, or one by one).
- **A DHIS2 indicator** is added as the data elements it is calculated from.
- **A data set** gives its reporting rate, reports received and reports expected: use it for the reporting
  completeness indicators.
- **More than one source**: their values are summed for each period and organisation unit.

## Sharing and reusing mappings

In the list on **Mappings**, each mapping shows its kind, its number of indicators and how many are mapped (**All
mapped**, **N not mapped**, **N not available**). Its buttons:

- **Edit** opens the editor; **Download** opens [New download](https://datasuite.damurka.com/en/apps/data-extractor/data-download.md) with this
  mapping.
- **⋯** > **Export to share** saves the mapping as a `.json` file (the mapping only, never data or passwords);
  **Duplicate** makes a copy; **Delete…** deletes it (downloads made with it are kept).
- **Import** reads a shared `.json` file and checks it against your server first: which indicators it matches, which
  sources your server lacks (those indicators come in as not mapped). If you already have a mapping of that name,
  choose **Import as a new mapping** or **Replace mine**.

If the extractor closed while you were editing, **Mappings** offers the unsaved mapping again: **Keep and edit** or
**Discard**.

## Common pitfalls

- **The same data counted twice.** Adding a data element and a DHIS2 indicator built from it, or a total and its
  parts, sums them both. Check the sources of each indicator.
- **Disaggregations left in by mistake.** Some data elements mix age groups or places of service; use **Edit** to keep
  only those that match the indicator's definition ([Indicator definitions](https://datasuite.damurka.com/en/methodology/indicator-definitions.md)).
- **Leaving indicators unmapped.** In a Countdown mapping, mark what the server does not collect as **not available**
  rather than leaving it, so you know it was checked.
- **Forgetting to save.** Changes are kept only when you click **Save mapping**.

Next: [Downloading data](https://datasuite.damurka.com/en/apps/data-extractor/data-download.md).
