In Q, you have the ability to analyze multiple data files in the same Q project file. The project can refer to multiple data files at once. When a project has two or more data files, the following are available in Q:
- Multiple Variables and Questions tabs; one for each data file.
- Multiple Data tabs; one for each data file.
- The ability to have tables and charts from different data files intermixed in the Outputs tab.
- The ability to have a table/crosstab that simultaneously shows data from two different data files (read on to find out how to achieve this.)
- The ability to have a time series plot that simultaneously shows data from two different data files (read on to find out how to achieve this.)
Two or more data sets that you want to load into the same Q project.
- To create crosstabs from using questions from different data files, there must be a variable in both files which contains the same type of data (text, categorical, dates, etc.) and has some values which match from which to create a relationship between two files.
- To create a time series chart using data from different data files, both files must contain a Date question with identical variable names and question names.
Adding Multiple Data Files
Once you have a project with one data set, use File > Data Sets > Add to Project again to add another file. You will then see the extra things listed above.
Crosstabbing Multiple Data Sources
Once you have a project with two data files, you have the ability to crosstab two questions from the separate data files. When you try and create crosstabs from questions in separate data files, you may be warned that you cannot crosstab questions from different data sources that do not have a relationship. To setup a relationship between the two data files select Combine > Data Sets > By Variable (By Case) (see Edit Data File Relationships for more details).
Once the relationship is setup, the sample size of a table will represent the number of respondents in the matched data.
If you wish to filter the table, and the relationship is Many-to-many, there must be a filter variable with the same Name and Label in both data files.
Charting a Time Series With Multiple Data Sources
Once you have a project with two data files, you have the ability to chart a time series that shows data from both data files.
The following prerequisites must be met:
- There must be a Date question in both data files with:
- The same Variable Name
- The same Question Name
- The same Question Type (Date)
- If you wish to filter the Time Series chart, there must be a variable with the same Name and Label in both data files. The tag must be turned on.
- If you wish to weight the Time Series chart, there must be a variable with the same Name and Label in both data files. The tag must be turned on.
With the above prerequisites met, you may create a Time Series chart with multiple data sources by following these steps:
- Click Create > Charts > Visualization > Time Series > Time Series with Dynamic Window.
- From the object inspector, go to Inputs > DATA SOURCE, select the type of data source you wish to use to create the Time Series Graph.
- If you wish to use an existing table go to Output and select the desired table from the drop-down menu.
- If you wish to use variables go to Variables and first select the Date/Time structured variable, followed by the Numeric variable. Alternatively, you can drag and drop the variables from the Data Sets tree into the menu itself.
- To input the data manually, select Paste or type table. A new dialog box window will open where you can paste or type in your data. Note that the table must meet the requirements as described above.
Using Weights and Filters
When you have two data files with no relationship between then, Q expects that the filter or weight variable to have identical names/labels and will allow users to choose a filter and it automatically works out which data set’s filter to use.
However, if you have a data file relationship, Q expects the weight/filter to only appear in one of the files. This is because if they appear in both, you end up with unresolvable logical problems.