Setting Up Files With No Metadata

From Q
Jump to: navigation, search

The precise steps required to use a data file that contains no or limited metadata, such as Excel files, CSV files and SQL databases, will depend upon how it has been created. It is generally difficult-to-impossible to correctly set up a CSV or Excel file without both access to the questionnaire and access to the person who exported the CSV file. Further, the process will be much easier if the file has been created in accordance with the Excel and CSV Data File Specifications (and better yet if in a better file different format).


Setting up a CSV or Excel File

  1. Select File > New Project.
  2. Select File > Data Sets > Add to Project > From File.
  3. After answering the next prompt, copy the variable labels from their source file and then go back to Q (generally this is best done using Excel; Q requires that each variable label be in a separate line).
  4. In the Variables and Questions tab, click on row 1 of the Label column.
  5. Using the scroll bar, go to the last row in the Variables and Questions tab. Hold down your Shift key and click on the last cell in the Label column. Your Label column should now be highlighted.
  6. From the Edit menu, select Paste Labels.
  7. Select all the variables with the same code frame and press the Values button (ValuesButton.png). To select variables from one contiguous group, click on the row number of the first variable, hold down the Shift key and click on the row number of the last variable. To also select data from a non-contiguous group of variables, hold down the Ctrl key and click on the next group of variables.
  8. Type in the correct value labels (e.g., 0 = Not selected and 1 = Selected). Alternatively, paste the labels in. (It can be helpful to first copy from within Q and then paste into Excel to appreciate the format that Q anticipates for the labels.)
  9. Click on the ValuesButton.png button for each of the remaining variables and enter in the correct value labels.
  10. Select the rows that correspond to the first multiple response question. Right click and select Set Question. Ensure that the question type and name of the question are correct. Click OK.
  11. Click on ValuesButton.pngto view the Value Attributes dialog box, so you can check that the correct values are being counted.
  12. Repeat this process for all the questions in the file.

Setting up when all the variables are Text

Sometimes CSV files contain all text. For example, rather than recording, say, a 1 for male the file instead contains Male. In such instances, the first things to be done are to:

  1. Select all the variables with a Variable Type of Text. (If the text variables are interspersed with other variables, you will need to do these steps for each set of adjacent text variables.)
  2. Change the Variable Type (e.g., to Categorical if that is appropriate).
  3. Press Up.png, which will group together all the categorical variables (the purpose of this button is to move all the variables up 1; in this instance the button is pressed because as a bi-product it puts all the variables together.)
  4. Re-select all the text variables and press H.png.
  5. Select Tools > Save Data as SPSS/CSV File and save it as a .sav file.
  6. Import the newly-created file as a new data file.

Setting up an SQL database

When importing an SQL Database, you need to follow all the steps described above for a CSV file.

In the current version of Q you can select File > Data Sets > Add to Project > From Database (SQL). However, the process for importing the data is slightly different in older versions of Q. You need to first import another data file and then add the SQL database using Add Data File To Project, after which you can delete the initial file. See SQL Data for more information.

See also

File Formats Supported by Q

Personal tools