Export option sets

Could there be a possibility of exporting a large list of an option set from dhis2? If so, how do you do it?

1 Like

Hi @herbert_kiwalya,

I’m not so sure bout this too… I’m copying @Emma_Kassy to have a look at this while we await other member’s feedback and ideas on the same.

Best,
James.

1 Like

Hi @herbert_kiwalya, would you like to take an export of the options, and their respective option sets in CSV/Excel, if so then you can use SQL views to generate a list.

2 Likes

Thank you @Saurabh, how do i access SQL views to generate it?

1 Like

Hi @herbert_kiwalya, it depends on version of DHIS2 in use, in and pre-2.29 SQL views can be found under Data Administration, from 2.30 they have been moved to Maintenance apps in Others tab.

You can create a SQL view with the following SQL statement, this will give the following variables for options such as Option Name, Option UID along with the Option Set name, you can download this information in a CSV/Excel file:

select OV.name as Optionname,OV.uid as OptionUID,OS.name as Optionsetname from optionvalue OV
inner join optionset OS on OS.optionsetid = ov.optionsetid

2 Likes

Thanks @Saurabh. When i execute the query, the view table is created but have no idea how to download it.

2 Likes

Hi @herbert_kiwalya, from the menu options, click on ‘Show SQL view’

image

Next, once the view is available, then you can use ‘Download as’ option to select the format in which you want to the data.

1 Like

Thanks @Saurabh

1 Like

I am in version 2.30 and was from 2.27 so I really had tough time finding where to create SQL Views. Thanks @Saurabh for the location.

2 Likes