Import data to DataSet

Hi there,
We have created a weekly DataSet & started entering data for this year, but is there a way to import past data for the same DataSet e.g. for the previous two years?
Reason is that we have old data saved in Excel & it would be easier to import than manually enter all of it, but I don’t know how it needs to be formatted/structured to import ok & thus be saved/viewable in DHIS2.
Any help is appreciated - I tried reading the User/Developer Guide but could not find a solution.
Thanks in advance :slight_smile:

1 Like

@ Damien
Hi Damien… Yes, you can import past data, however, you need to prepare your legacy data manually with the right format … I imported 2 years backlog data for one of the programs with the attached CSV format. …if this helps check this attached CSV file…CSV file.csv (195 Bytes)


Hi Damien,

Check the DHIS2 documentation at Metadata - DHIS2 Documentation for the format needed.

We ended up doing a lot of importing and wrote some R code to automate the conversion of Excel files into the necessary CSV format – see GitHub - hazimtimimi/dhis2_import: Reformat data from typical 'wide format' Excel spreadsheets into CSV files conforming to DHIS2 data import specifications, including transforming orgunit names and data element codes into DHIS2 internal unique identifiers.

The tricky thing is converting data element names and organisation unit names to the relevant UIDs.

Good luck!


Thanks guys, muchly appreciated - found a link that helps me format the CSV file the right way (wasn’t looking correctly before): Metadata - DHIS2 Documentation
The importing is not that much for now but good to know the R package exists, in case it grows & needs it.

Take care :slight_smile:

1 Like