User Tools

Site Tools



Importing Spreadsheet/CSV Data

Prepare Your Data

Clean the Spreadsheet/CSV file

  • One data type per column. If you want a column analysed as a number e.g. 60, 102.5, 3, etc remove text such as “n/a”, “removed” etc. SOFA can cope with mixed data types by getting you to choose an overall type as you import (unless you select text, data of the other types is converted to missing values). But you will have to decide what to do for each and every column every time you import the data. So it is probably best to clean it before attempting an import.
  • One header row (or none) only. SOFA can't handle multiple header rows so tidy that up first
  • Unique field names. SOFA can handle duplicate field names (it appends 001, 002 etc to make the names unique) but it is probably better to make the names yourself.
  • Remove empty rows and columns at beginning. They may make the layout more appealing but SOFA expects the first row to be either the header row or the first data row.

  • Remove additional worksheets. SOFA is only set up to import a single worksheet.
  • (For CSV) - Get rid off blanks in your csv e.g.
    female, ,43,Austria
    will treat the value after “female” as “ ”, not as a missing value. So change it to
    Notice the commas are right next to each other.

Structure the Data for Analysis

SOFA expects your data to be organised in a particular way. E.g. should I have gender as a field with 1s and 2s in it and height as another field or should I have a column of results e.g. height, for each gender? SOFA only works with the first structure. Check Structuring Data For Analysis if not sure or if there are problems.

Importing Local Data

SOFA Statistics currently supports importing data from Excel spreadsheets, ODS spreadsheets (OpenOffice Calc and Gnumeric etc), csv files and Google Docs spreadsheets.

NB you do not need to import data from SQL-type databases (currently MS Access, PostgreSQL, MySQL, MS SQL Server, and SQLite). See Connecting to databases

  1. Click on the “Import Data” button on the main SOFA form
  2. To import local data, click on “Browse” and select csv, xls, or ods file

  3. Provide the data with a unique name by which SOFA Statistics can identify the data.

    Then click on the “Import” button to import the data into the default SOFA database “sofa_db” with the table name provided.

A video is available showing how to import CSV data: Importing CSV data video

A video is available showing how to import Open Document Format (ODF) spreadsheets: Importing Open Document Format (ODF) spreadsheets video

Another video is also available showing how to import data using SOFA Statistics:



help/importing.txt · Last modified: 2015/10/31 03:21 by admin