Create and extract a custom table with data from different datasets using the data cart

The data cart tool on statistics.gov.scot provides an easy way to download custom combinations of data from datasets in the site. This guide describes:

  • What the data cart is
  • How to add data to the data cart
  • How to remove data from the data cart
  • How to download and share a data cart
  • Adding from a saved cart to a new cart

What the data cart is

The data cart is a way of building up a custom spreadsheet, with data from one or more datasets.

You can choose both rows and columns, and end up with a table which cross-references statistics (columns) against geographical areas (rows). You can then download or share this custom table. Find how to find, add and download multiple collections of areas here.

Add data to the data cart

Click on the Data Cart tab in the top toolbar to view your cart. This is what an empty data cart looks like.

To build up your cart, you need to add rows (areas) and columns (data) to it using the ‘Add to cart’ button. Say, for example, you wanted to get data for the ratio of median house prices to median earnings, and the number of new builds being built across the country, so that we can compare them in excel, or show them in a GIS. You can use the Data Cart to do this.

First, find the data sets that you're interested in, and filter the dataset until you view the data in a table.

For the ‘New build housing starts and completions’ dataset, you might get to a table that looks like this:

You can add all columns using the  ‘Add 86 columns to data cart’ button  or you can add just one column by clicking on the column header and selecting ‘Add column to cart’. You can add as many individual columns as you wish like this.

Once a column has been added, there’s a confirmation at the top of the screen and the data cart status at the top of the page will be updated:

In this example I’ve added all new build housing starts for each quarter of 2012. Then I went to a table of median house prices (from House Prices dataset) and added a column for the 2012 reference period. After that I added a column from a table of Earnings. Now there are 3 filtered datasets  in the cart - new build starts, earnings and house prices.

Add rows to your cart

Note that adding columns doesn't add any actual data yet, but it records the fact that you're interested in those columns. For the cart to return data you also need to tell the cart tool which rows (areas) you're interested in.

To add rows to your table, you need to add areas. To do this, find areas you want to add by searching by place name or postcode in the Search box or go to the Atlas Tab and scroll down the page to the map and list of area types, organisations and place names.

Search

Search will give you a list of area results for that keyword.

In this example I want the data for datazones across Perth, so first I select Perth and Kinross council area. This takes me to the atlas page for that area. Scroll to the Location section, which gives a list and map view of all area types within Perth and Kinross council area.

Below the map is a list of all datazones, ordered alphabetically. In my example I want to add them all so I click on the ‘Add rows to datacart’ button.

Alternatively, you can use the Atlas section to browse for an area and add areas from there.

Atlas

View your cart

Your data cart now shows that there are 3 filtered datasets and 186 geographical areas, as shown in the data cart tab. Clicking the data cart tab will show you this:

There are a variety of different ways of adding data to a cart, but we've just demonstrated the simplest way.

It is also possible to only add specific geographical areas, or you can choose to add all columns from a particular dataset in one go. Look out for the buttons with a shopping cart and plus sign!

Edit your in-progress Data Cart

Before we save the cart for download, we can optionally remove  specific filtered datasets (columns) or geographic areas (rows), by simply clicking the white cross on red button next to the item in the cart:

Download and share data from a data cart

Once we are happy with the content of our data cart, we can press Save. This will save this version of the data cart, ready for us to download or share.

To download the cart, select the CSV button. This will export the data onto your system so you can work with it in Excel.

To share a cart, you can just send someone (or share on social media) the link under the "Share" heading. This particular one is: https://statistics.gov.scot/carts/43b8ec81-6ab5-4388-8f08-d0e0b353d5b8

This URL for a particular cart will never change.

Note: Once you've saved a cart, you can't edit it again (so that the contents stay consistent for anyone you've shared it with!). However, you or anyone you've shared it with can add rows and columns from a saved cart into your new (empty) in-progress cart.

Adding from a saved cart to a new cart

To add multiple areas from a previously saved cart, paste the saved cart’s URL (link)  into the web browser. This will take you to the saved cart. Click on the contents tab to see the data and areas saved in the cart.

In this example the saved cart contains all intermediate zones for Edinburgh City and Glasgow City. To add all these areas, click on the add to Data Cart button for all the rows.

... or select the areas you want to add from the saved cart by row.

You can then add the data (and any other areas) you want to your new Data Cart as usual. More in [this guide](link to guide ‘Create and extract a custom spreadsheet with data across datasets’).

Summary

Creating a custom spreadsheet using data across datasets
  • Add data to the data cart
  • Add rows (areas) to the data cart
  • Make any edits you want to the cart
  • Save the cart
  • Share the cart and/or download the cart
Adding to a saved cart
  • Paste the URL (link) of the saved cart in your web browser
  • Go to the contents tab
  • Add the rows you want to your cart

To continue exploring our datasets, return to statistics.gov.scot

Still need help? Contact Us Contact Us