12.5. Download data from a pivot table

12.5.1. Download table layout data format

To download the data in the current pivot table:

  1. Click Download.

  2. Under Table layout, click the format you want to download: Microsoft Excel, CSV or HTML.

    The data table will have one column per dimension and contain names of the dimension items.

[Tip]Tip

You can create a pivot table in Microsoft Excel from the downloaded Excel file.

12.5.2. Download plain data source format

You can download data in the current pivot table in JSON, XML, Excel, and CSV as plain data formats with different identification schemes (ID, Code, and Name). The data document uses identifiers of the dimension items and opens in a new browser window to display the URL of the request to the Web API in the address bar. This is useful for developers of apps and other client modules based on the DHIS2 Web API or for those who require a plan data source, for instance for import into statistical packages.

To download plain data source formats:

  1. Click Download.

  2. Under Plain data source, click the format you want to download.

    Table 12.3. Available formats

    Format

    Action

    Description

    JSON

    Click JSON

    Downloads JSON format based on ID property.

    You can also download JSON format based on Code or Name property.

    XML

    Click XML

    Downloads XML format based on ID property.

    You can also download XML format based on Code or Name property.

    Microsoft Excel

    Click Microsoft Excel

    Downloads XML format based on ID property.

    You can also download Microsoft Excel format based on Code or Name property.

    CSV

    Click CSV

    Downloads CSV format based on ID property.

    You can also download CSV format based on Code or Name property.

    JRXML

    Put the cursor on Advanced and click JRXML

    Produces a template of a Jasper Report which can be further customized based on your exact needs and used as the basis for a standard report in DHIS2.

    Raw data SQL

    Put the cursor on Advanced and click Raw data SQL

    Provides the actual SQL statement used to generate the pivot table. You can use it as a data source in a Jasper report, or as the basis for an SQL view.


12.5.3. Download a CSV format without rendering data in the web browser

You can download data in CSV format directly without rendering the data in the web browser. This helps to reduce any constraints in the system settings that has been set with regards to the maximum number of analytic records. This lets you download much larger batches of data that you can use for later offline analysis.

To download data in CSV format without first rendering data in the web browser:

  1. Click the arrow beside Update.

  2. Click CSV to download the format based on ID property.

    The file downloads to your computer.

    [Tip]Tip

    You can also download CSV format based on Code or Name property.