2016-12-09

User guide to the data portal

  • The SNB data portal provides a collection of predefined tables arranged by topic (Table selection), and access to comprehensive and detailed datasets, as well as associated notes.

  • Forthcoming data updates are shown in the Calendar.

  • Further information on methods and definitions relating to the published data can be found in the Notes.

  • Tables from the table selection that are updated together are bundled into publication sets. A publication set can contain tables from various topics.

  • A link is published together with the announcement of the data update under the news section on the homepage. By clicking on the link, a list of the tables updated in the respective publication set will appear.

  • The page header allows rapid navigation to the tables, datasets, notes and calendar. In addition to accessing general information (contact, help), it is also possible to select the desired language: German (DE), French (FR) or English (EN).

  • If you have any questions on data portal content, background or use, please contact publications@snb.ch.


Table selection and datasets: Key facts

Table selection

The table selection is a collection of predefined, configurable tables on various topics. The data stem from both the SNB’s own surveys and from external sources. The tables are compiled with the aim of providing as comprehensive an overview as possible of a topic.

The tables are accessed via the topic headings, which are listed under the ‘Table selection’ menu; this appears both on the homepage and in the header of each page. You can navigate to tables or explanatory notes on each topic.

Tables illustrate a predefined selection of data. Data users can personally configure the tables, selecting or deselecting items by clicking in the box in the query panel above the table. It is also possible to change the date range of the data.

The navigation on the left-hand side enables further tables to be selected on the same topic. You can change topic by calling up the topic headings using the ‘Table selection’ button.

Datasets

The datasets are detailed time series of selected datasets from the SNB’s own surveys. Data from external sources are not included. The time series are shown in table form, and the tables are compiled on the basis of the underlying data model. The tables illustrate the details available on a specific aspect of the survey data.

The time series can be accessed by selecting the ‘Datasets’ menu located both on the homepage and in the page header.

The selection of time series can be narrowed using the filters on the left. By selecting a filter, the number of both the available time series and the other possible filter options is dynamically adjusted.

When a topic is selected on the right-hand side, the associated table is displayed. Data users can personally configure these tables (as in the table selection), selecting or deselecting other items by clicking in the box in the query panel above the table. It is also possible to change the date range of the data.

Data model for tables

The tables in the data portal are a two-dimensional representation of statistical data. These data are divided into between one and ‘n’ subject-specific dimensions (hypercube). For example, a subject-specific dimension can be a breakdown by country.

Moreover, each table has another dimension: time, with (mostly discrete) reference dates. The data in a table or dataset can therefore also be regarded as a collection of time series. All the data in a table have the same frequency.


Using the table selection

A topic can be selected under ‘Table selection’ > ‘Topic overview’. Once a topic is selected, the data window page appears.

Data window layout

The data window comprises the following elements:

  • Navigation panel. On the left-hand side is a navigation panel, which presents the entire topic in the form of a navigation tree. The tables are identified by a table symbol.

  • Table panel. This contains the following elements:

    • In the title panel, the date of the most recent update is shown next to the table designation.

    • The query panel allows data to be filtered according to various dimensions. These dimensions are arranged into sheets. In the lower panel section, the date range can be specified. In addition, various methods for data download are displayed.

    • In the data panel, the data are presented in table form.

    • Supplementary information is shown below the tables.

Selecting tables in the navigation panel

The navigation panel presents the subtopics and tables for the selected main topic in the form of a navigation tree. The desired table can be selected by mouse-click. Tables are identified by a table symbol. The selected table is marked in the navigation.

The navigation tree can be fully expanded by clicking the double arrow next to the topic title. This can also be used to collapse the navigation tree again, so that only the subtopics are visible.

The navigation tree also shows explanatory notes. These are marked with a paperclip symbol.

The navigation panel contains a search field. As the search term is being entered, the navigation tree reduces the displayed entries to show only those containing the search term.

The arrow symbols to the right of the search field in the navigation panel can be used to switch between tables.

To the left of the search field is a minimisation symbol. Clicking on the symbol hides (or shows) the navigation panel, so that the size of the data display area can be adjusted.

Layout of table panel in the data window

Basic information on the table

Each table has a title. In addition, the date on which the data for this table were last updated appears beside the title. Moreover, tables can have subtitles and information on the unit of measure for the displayed figures.

Each table also has a technical identifier. This is shown in the page URL (/cube/identifier).

Query panel

The query panel offers a variety of options for working with the data in the displayed table.

Applying filters and viewing the table structure

Initially, the query panel shows the available dimensions for the data in the table. Each dimension is presented as a separate sheet.

Each sheet lists the parameters defining that dimension. Each parameter has a checkbox. If the box is checked, a parameter is selected. Only data with the selected parameters will be displayed in the table.

For tables, the default setting displays a pre-selection of checked boxes. In other words, the data shown in the tables are already partly filtered, in order to keep the table to a manageable size.

If the table is made up of multiple subject-specific dimensions, several sheets are shown in the query panel. You can click the sheet tabs to switch between sheets and view the parameters for the different dimensions.

Each sheet tab shows how many of the available parameters have been selected. The tab ‘result size’ shows how many of the available time series have been selected. For instance, ‘result size 8/12’ means that 8 out of 12 time series are currently selected. ‘Result size 0/12’ indicates that no time series is available for the specified filter settings. This is occasionally the case for some tables.

If you mouse over the name of a parameter in the filter, a separate window appears showing the full title and an identifier. This is part of the technical identifier for that time series.

The date range for displaying data can be narrowed or expanded using the menu in the lower section of the query panel.

Click on ‘Refresh’ for the changes to the filter settings to take effect in the table display.

Clicking on the minimisation symbol in the top left hides (or shows) the query panel, so that the size of the data display area can be adjusted.

Downloading data

In the query panel of the data window, a number of data download options are available. You can choose whether to download only the current table view (selection) or all available data for the relevant table. You can also choose between two file formats: Excel or CSV (comma separated value). MS Excel files contain, in addition to the data, information from the table headings and information on any breaks in series. CSV files are suitable for importing into various data analysis programs.

The downloaded figures are in some cases available to a greater degree of precision (more decimal places) than shown in the interactive table.

The data panel offers a few interactive options for viewing data:
  • If a figure is bold, this indicates that it was a new entry at the last update (of an existing time series), or that the figure was changed during the last update.

  • Mousing over a figure for which a different value had been published will cause its change history to be displayed. This history shows the previously published values, together with the last publication date.

  • Breaks in series are shown as black bars. By clicking on the bar, users can see an explanation of the break in the series.

  • Some table headings have entries with superscript numbers. These contain additional information, which is revealed by clicking on the number.

  • Long entries in table headings cannot always be fully displayed. To reveal the complete text, mouse over the entry.

  • Clicking on the M symbol in the table caption reveals meta information on the time series, including the time series identifier. This is useful for submitting queries to the SNB and for a future automatic download service.

  • Mousing over an empty or crossed-out field will provide an explanation of the field. An empty field means that the data are confidential or not available. Crossed-out fields are not applicable.

Supplementary information panel

This panel is located below the tables, and lists all explanations on breaks in series, in addition to supplementary information.


API documentation

The application programming interface (API) allows access to the published tables. Access is via https, and the results are delivered in CSV format.

Obtaining data

The latest version of all available data in the table selection can be obtained in the form of CSV files, as in the following example:

https://data.snb.ch/api/cube/snbbipo/data/csv/en

In this example, snbbipo is the technical identifier for a table. This is shown in the URL for that table in the data portal and in the table downloads.

The latest versions of all available data in datasets can be obtained in the form of CSV files at, for example:

https://data.snb.ch/api/warehouse/cube/BSTA.SNB.JAHR_U.BIL.AKT.TOT/data/csv/en

In this example, BSTA.SNB.JAHR_U.BIL.AKT.TOT is the technical identifier for a table in a dataset. The identifier is shown in the URL for that table in the data portal and in the table downloads. However, for datasets, the special character @ in the identifier must be replaced by a full stop (‘.’).

Checking for updates

Information on the creation date and most recent update of a table can be obtained in JSON format, for example:

https://data.snb.ch/api/cube/snbbipo/lastUpdate

In this example, snbbipo is again the technical identifier for the desired table.

This query can be used to find out whether new data are available (in addition to the announced schedule). It can be used at your discretion.

We do not recommend performing repeated queries on unchanged CSV files, since this places unnecessary strain on the data portal.

If excessive use of the API leads to malfunctions of the data portal, we will be obliged to block the IP address of the user concerned.

A query is also available for the dataset tables, for example:

https://data.snb.ch/api/warehouse/cube/BSTA.SNB.JAHR_U.BIL.AKT.TOT/lastUpdate

In this example, BSTA.SNB.JAHR_U.BIL.AKT.TOT is the technical identifier for a table in a dataset. However, for datasets, the special character @ in the identifier must be replaced by a full stop (‘.’).

Technical identifiers

CSV files use only technical identifiers for dimensions and hierarchical code lists. However, natural language identifiers are considerably more helpful in comprehending a table. The dimensions and hierarchical code lists for a table can be requested in JSON format, as shown in the following example:

https://data.snb.ch/api/cube/snbbipo/dimensions/en

In this example, snbbipo is the technical identifier for the desired table. The results show the technical identifiers for all dimensions and hierarchical code lists mapped to natural language identifiers. Results can be shown in German (de), English (en) or French (fr).

A query is also available for the dataset tables, for example:

https://data.snb.ch/api/warehouse/cube/BSTA.SNB.JAHR_U.BIL.AKT.TOT/dimensions/en

In this example, BSTA.SNB.JAHR_U.BIL.AKT.TOT is the technical identifier for a table in a dataset. However, for datasets, the special character @ in the identifier must be replaced by a full stop (‘.’).

For further support or a sample implementation, please contact publications@snb.ch.