Results can be exported to an S3 bucket on Amazon Web Services (AWS) which is linked to your DAE account. Exported results, including data tables, charts and graphs can then be downloaded and saved to your computer.
Downloads are only available if specified in your Data Sharing Agreement (DSA).
Exporting and saving your results
Depending on the terms agreed in your DSA, some users will be permitted to export and save outputs without checks, whilst other users will be required to have their outputs reviewed by an Output Checker in our Safe Output Service before they can be downloaded. This is to ensure that requests cannot be linked to an individual patient and that a patient cannot be identified due to not applying aggregations to the data, or by exporting a small number of records.
The Data Out field on the DAE Agreement screen displays your export permissions.

The table below provides details on the different permissions available for Data Out, depending on your DSA:
Data Out |
Description |
ESCROW |
Downloads are available. Your export request will be reviewed by the Safe Output Service. See the Reviewing results section for further information.
ESCROW is the name used by the system for the Safe Output Service. |
Yes |
Downloads are available. Your export request will not be checked by the Safe Output Service and will be automatically copied to your AWS S3 account. |
No |
Downloads are not available. |
Reviewing your results
If your DSA requires your exported results to be reviewed before download, your request will be processed by the Safe Output Service. You will receive an email once your request has been processed.
- Your request may be rejected if it does not meet our disclosure control guidance. You will receive an email explaining the reasons as to why your output could not be approved.
- If your request is approved you will receive an email confirming that your output is available to download from your AWS S3 account.
For information on the criteria to follow to enable a quick review of your export please refer to the Safe Output Service section.
Export file formats
The following export file formats are supported within DAE:
csv, html, png, excel, zip, python
Exporting results to CSV
If your export request needs to be reviewed before download, you must ensure that you use clear descriptors for the column names or your download may be rejected.
To create a CSV file:
- Run the code to create your output.
- Click on the Download CSV button.

Databricks will display the first 1,000 rows of data by default.
- If you have more than 1,000 rows of data, click on the down arrow next to the Download CSV button and select Download full results from the drop-down menu.

If your DSA requires your results to be reviewed before download you will receive a confirmation email when your export request has been processed.
Exporting graphs as PNG
You can export graphs in Python notebooks, including graphs created using Matplotlib, as a PNG file.
If your export request needs to be reviewed before download, you must clearly label the axis names and title of your graph or your download may be rejected.
To create a PNG file:
- Run your SQL code or use "display(...)" on a spark dataframe or matplotlib figure.
- Press the Bar Chart button then use the Plot Options to design your plot.
- Click on the Download plot as a PNG button.

The file will be created with a randomised file name which cannot be changed.
To create a PNG file where you can define the file name (matplotlib plots only):
- Right click and select Save image as from the drop-down menu.

- Enter a name for the PNG file.
- Click Save.

If your DSA requires your results to be reviewed before download you will receive a confirmation email when your export request has been processed.
Exporting results to HTML
Exporting your results as an HTML file will enable you to include additional contextual information as a comment line in your output. This will provide more information for the output checker and help ensure that your download is not rejected.
Any data table, charts and graphs contained within the HTML file will be accessible after downloading the file. The HTML file will act as a container for both the export results and the contextual information.
To create an HTML file:
- Create your results (data table, chart or graph) in a notebook.
- Add a comment above the results to provide contextual information (see example below).
- Run your results.
- Export as an HTML file by selecting File > Export > HTML.

If your DSA requires your results to be reviewed before download you will receive a confirmation email when your export request has been processed.
Exporting a Python file
Exporting your results as a Python file will allow you to include comments in your output. This will provide more information for the output checker and help ensure that your download is not rejected.
The exported file will only contain raw text. Graphs will not be included..
To create a Python file:
- Add a comment above the results to describe what the code does.
- Run your notebook.
- Select File > Export > Source File.

If your DSA requires your results to be reviewed before download you will receive a confirmation email when your export request has been processed.
Downloading your results
If your results required review, they will be copied to your AWS S3 account following approval. They will then be ready for you to download to your computer.
If your results did not require to be reviewed they will be automatically copied to your AWS S3 account.
To download your results:
- Login to the AWS S3 bucket.
- Enter your DAE Username and Password and two-factor authentication code.
The AWS Management Console screen will be displayed.
- In the Search field type S3.
- Press Enter.

- Select S3 Scalable Storage in the Cloud.

- On the Buckets screen, select the NHSD-DSPP-DAE-Data-Out item.

Please note that although Access displays ‘Insufficient permissions’ you will be able to continue with your download.
You will be presented with a list of folders.
- Select the folder with your name in the title.
- Click Open.

The list of files in your folder will be displayed.
- Select your results file.
- Click Download.
All CSV files are named export.csv by default and cannot be changed.

On Windows PCs the file will be stored in your default ‘Downloads’ folder. Depending on your local security, some browsers will allow you to open the file from a dialogue box on the page.
Output considerations
You should only export one query at a time, in accordance with your DSA.
Use of escape characters have been made in Excel outputs to ensure the field type integrity. These escape characters only appear when editing a cell and make no difference to the data, other than informing Excel how to display the content.
Data awareness training
The Safe Data Access Professionals Group helps share expertise, best practice and knowledge between organisations engaged in providing secure access to confidential sources of data from the health and social science research sector.
These free data awareness training courses and modules provide you with best practice information on working with statistical data and can be accessed on the Secure Data Group website.