In some cases you may want to rename variables from your original data file. This can be the case, for example, when updating a project with a new data file where a variable has been renamed in the new data file.
Only variables that are created in Q can be renamed, whereas variables from the original data file cannot. The original variable names are grey in color where as those created in Q are black. The reason that Q does not allow you rename the variable is because it the underlying raw data file is never modified which make things like updating your data set possible.
This article describes how to take a file with original (and uneditable) source variable names:
To a file with renamed variables:
Do the following to create a new data file with renamed source variables:
- Select File > New Project.
- Select File > Data Sets > Add to Project > From File.
- In the Data Import window, select Use original data file structure
- Expand the Advanced section.
- Uncheck both Tidy Up Variable Labels and Strip HTML from Labels.
- Click OK.
- Right-click on the variables that you want to rename and select Copy and Paste Variable(s) > Exact Copy.
- In the Name column, change the variable name of the new variable copies.
- Hide the original variables by clicking on the "H" in the Tags column (optional).
- Select Tools > Save Data as SPSS/CSV File to save a new copy of the data file, then click OK.
- Enter a file name and save it to the desired folder.
A new data file reflecting the changes that you've made to the variables is created. Load the new file into Q and note that the variables have been renamed.
How to Automatically Rename Column Labels in Tables
How to Automatically Rename Row Labels in Tables
How to Automatically Change Table Names in a Report
Article is closed for comments.