Tips and tricks to access and take away Statistics Canada data

There are multiple ways to access and take away Statistics Canada data depending on the software you have at hand. Such as Excel, or Tableau and Power BI.

1.There exists a Web Data API which returns vector (shortcuts to data points) data in JSON format. Typically needing a programmer to set up this kind of access.

User Guides are found here: Web Data Service (WDS) We have some Excel, Python, R, AJAX, SAS examples if requested.

2. Users can also retrieve the Full Table Download in CSV format, compressed in a ZIP including data and metadata.

The guide to the CSV format is found here: Full Table Download (CSV) User Guide


3. You can retrieve custom CSV directly from the external website using the following methods: Download data as displayed on screen. Taking away a CSV output after customizing the view by hand. (LFS hourly wages example: Hourly wage distributions by occupation, monthly, unadjusted for seasonality)

For your user community, using the new Download selected data format is an easier way for users to filter and download directly into CSV. See the following examples that are not advertised but still possible on our site for expert users who could re-use these shortcuts for easy linking to generated CSV files.

Simply once a table has been customized in the Add/Remove section, when clicking on the Download Options overlay, a user can Right click over the Download Selected Data and using the "Save Link Location…" or in Internet Explorer "Copy Shortcut" you can extract the custom link to generate the CSV on the fly.

A CSV retrieval with a time period parameter included looks like this:!downloadDbLoadingData-nonTraduit.action?pid=1010013201&latestN=&startDate=20180101&endDate=20180301&csvLocale=en&selectedMembers=%5B%5B1%5D%2C%5B1%2C2%2C3%2C4%2C5%2C6%2C7%5D%5D

This retrieval shows latest N(5) periods, instead of a time period, it looks like this:!downloadDbLoadingData-nonTraduit.action?pid=1010013201&latestN=5&startDate=&endDate=&csvLocale=en&selectedMembers=%5B%5B1%5D%2C%5B5%2C7%2C1%2C6%2C4%2C2%2C3%5D%5D

4. Also, a user can also bookmark the URL using Save my selections so your community could easily return to the same customized table, month after month.

Save my selections looks like this for the same example table, but comes back to the online GUI, to allow edits to the filters.!recreate.action?pid=1010013201&selectedNodeIds=1D1,2D1,&checkedLevels=&refPeriods=20180101,,20181001&dimensionLayouts=layout2,layout3,layout2&vectorDisplay=false

5. Using the Search by Vector feature is also a quick way to download many data points from a variety of tables at once, here is an example:

6. Additional ways to take away data:

  • A daily Delta File of all the data points that have changed for the day. This method would be for high volume users that want to recreate our database in their systems. Information on this method is found in our Developers pages: (For example: Delta File)
  • Download Full Table in SDMX (XML) format.
  • Download hundreds of single number Indicators of content through a JSON Indicators API found here at the bottom of the page: Developers
  • Subscribe to tables to be emailed when they are updated through "My Statcan" found here: My StatCan

Additionally, if Option 3 does not work for you, there are options to break apart and use the large Full Table CSV files to load them into Excel as follows:

For the large Full Table Download CSV files, you could consider:

  • Using a CSV splitter similar to this open source one for Windows: Free Huge CSV Splitter
  • Using Power Query in Excel

Opening large CSV files using power query in Excel


Excel 2016 - Power Query comes standard

Previous Excel versions - Power Query needs to downloaded and installed as an add-in before being available for use


Power Query for Excel can be downloaded from the Microsoft Download Center. Installation instructions are also provided at this location. Download Microsoft Power Query for Excel


Once Power Query has been installed you can open and extract parts of large .csv files by following these steps:

  1. Select "Power Query", "From File", "From CSV".
  2. Select the file that you wish to view or manipulate (a new window will open showing the first few lines of this file with all the column headings).
  3. From the "Query Editor" window, you can filter the information using the dropdown selections in each column.
  4. Once the proper filters have been applied, you can extract that part of the file by using the "Keep Rows", "Keep Top Rows" option.
  5. This option will then ask how many rows you would like to keep for future extraction.
  6. You can then proceed to extract this information by using the "Close & Load", "Close & Load To" option.
  7. Finally, you will be given the option to place these rows in a new Excel worksheet for analysis or manipulation.

More information:

Many more functions and manipulation options that have not been discussed above are available through Power Query, thus allowing the user to open and extract parts of massive .CSV files.

More information on this topic can be found online.

Depending on how familiar you are with Pivot Tables in Excel, you can also using the Data Model source function in Excel to use the CSV file as a Pivot Table Data Model source. Loading CSV/text files with more than a million rows into Excel

Microsoft Power BI DaX:


GetCoord = (prodid as text, coord as text, period as text) => let

Json = Json.FromValue({[productId=prodid, coordinate=coord, latestN=period]}),

Getdata = Json.Document(Web.Contents("", [Headers=[#"Content-Type"="application/json"], Content=Json])),

#"Converted to Table" = Table.FromList(Getdata, Splitter.SplitByNothing(), null, null, ExtraValues.Error)


#"Converted to Table"


Date modified: