Introduction
If you have aggregated data and just want Q to visualize it - you can paste in data to make this happen.
Requirements
- A data set loaded in Q.
- Additional variable or variables in Excel containing the same number of cases as in the Q data set.
Method
You can paste new variable(s) from Excel into Q as follows:
- Open Excel and copy the variable that you wish to paste.
- In Q, go to the Data tab.
- Set the Case ID using the drop-down at the top-left of the Data tab.
- Go to the Variables and Questions tab.
- Right-click on the row number where you want to paste the variable.
- Select Insert > Variable(s) > Paste Data (e.g., From Excel).
You can also do this from the Data tab by right-clicking on the column header where you want to paste the data.
If pasting multiple variables, the first row must contain variable names (i.e., and thus they may not have punctuation or unusual characters in them, such as spaces or returns).
The "Not enough values included" error message
If you paste in fewer cases than are in the existing Q dataset, you'll receive the following error message:
assuming that you have checked that the number of rows you are pasting is the same as the number of rows in Q, the explanation for this is likely to be that there are inappropriate characters in your data. Most commonly these are various types of return characters, but it is possible that there are other invisible characters in the cell.
Bugs in Excel make this a slightly painful process. In theory, the first approach below should be sufficient, but in practice it is often necessary to take additional steps to clean the data.
Find and Replace 1
- In Excel, select all the cells that you want to paste into Q.
- Open the Find and Replace dialogue box.
- Put your cursor in the Find what box, hold down the Ctrl key on your keyboard and press the j key. It will not look like much has happened, but if you look carefully you should see a small flashing comma.
- In the Replace with box type // (or whatever else you would like to use to indicate a new line).
- Press Replace All.
Find and Replace 2
- In Excel, select all the cells that you want to paste into Q.
- Open up Find and Replace.
- Put your cursor in the Find what box, hold down the Alt key on your keyboard and quickly type 0010. It will not look like much has happened, but if you look carefully you should see a small flashing comma.
- In the Replace with box type // (or whatever else you would like to use to indicate a new line).
- Press Replace All.
Refreshing Excel
- Close and restart Excel.
- Remove any auto-filtering.
- Check that you are not using Excel in Read Only mode.
- Do the Find and Replace approaches again.
Using clean
Use Excel's clean formula.
Next
How to Update Value Attributes by Cutting and Pasting