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
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)
Check the DHIS2 documentation at https://docs.dhis2.org/master/en/developer/html/dhis2_developer_manual_full.html#webapi_csv_metadata_import 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 https://github.com/hazimtimimi/dhis2_import
The tricky thing is converting data element names and organisation unit names to the relevant UIDs.
Thanks guys, muchly appreciated - found a link that helps me format the CSV file the right way (wasn’t looking correctly before): https://docs.dhis2.org/master/en/developer/html/dhis2_developer_manual_full.html#webapi_data_values_csv
The importing is not that much for now but good to know the R package exists, in case it grows & needs it.