This article describes how to bring a variable over from one linked data set to another. This is useful when you wish to make calculations (all R-based calculations and variables) that require all your variables to be in the same data set.
- A document with two data sets loaded in the Data Sets tree.
- A Relationship between the files. See How to Link Data Sets Together in a Document for details.
- Note, this approach can only be used in a One to One or One to Many relationship where you are copying data from a data set that represents the One part of the relationship. It cannot be used with a Many to Many relationship which is instead performing Data Fusion.
1. Select the Data Set in the Data Sets tree where you wish to add the variable. In this example, our data set is called File1 and we are bringing a variable over from File2.
You can also enter this manually using the below format:
The source_variable_name will match Properties > GENERAL > Name, and the source_data_set in this case would be File2.
4. Change Properties > Structure to the correct data type.
5. OPTIONAL: If you are copying over a categorical variable such as Nominal or Ordinal, it will only carry over the values. You can, however, copy over the labels by doing the following:
- To copy the labels, select the source variable in the Data Sets tree and go to Properties > DATA VALUES > Labels > Export > CTRL + C.
- To then apply this to your new variable, select it in the Data Sets tree and go to Properties > DATA VALUES > Labels > Import > CTRL + V > OK.