In this article
Troubleshooting SPSS data import
If you receive an error message when uploading a SPSS (.sav) data file to Forsta Visualizations, use the following tips to solve common issues.
1: Include Required Variables
Forsta Visualizations requires that three variables are included in each new uploaded data file.
If you upload a dataset without the RespondentID, ResponseDate, and Weight variables named as listed, the following validation error(s) display:
No variable has been marked as respondent id
No variable has been marked as respondent weight
No variable has been marked as response date
Note: Updating an existing data file only requires the RespondentID to be identified.
To identify these three variables, you can:
Use Meta data transformations to identify the variable(s)
Use Meta data transformations to create the new variable(s)
Rename the variable(s) as expected in the original data file
1.1: Use Meta Data transformations to identify the variables
In Forsta Visualizations, open the Meta data transformations modal. The error message displays again.
Right-click the variable and select the appropriate option from the context menu.
-
To identify the
RespondentID, right-click the row with the appropriate Question Code to open the context menu. Respondent IDs must be unique and numeric. From the context menu, select Set variable as Respondent ID. The row will now display the Respondent ID icon, which looks like a thumbprint. -
To identify the
ResponseDate, right-click the row with the appropriate Question Code to open the context menu. From the context menu, select Set variable as Response Date. The row will now display the Response Date icon, which looks like a calendar. -
To identify the
Weight, right-click the row with the appropriate Question Code to open the context menu. From the context menu, select Set variable as Weight. The row will now display the Weight icon, which looks like a set of scales. If there are multiple weight variables, select only one. You can select more later.
1.2: Use Meta Data transformations to create new variables
If your data file does not contain one or more of these variables, you can create "artificial" variables within Forsta Visualizations to represnt the Respondent ID, Response Date, and/or Weight. Right-click any row in the Meta data transformations modal and select either Create Respondent ID variable..., Create Response Date variable..., or Create Weight variable... from the context menu as appropriate.
1.3: Rename the variables in the original data file
Open the data file, and rename the variables as follows.
RespondentID: unique numeric identifier per case (respondent)ResponseDate: the day the case (respondent) was interviewedWeight: the weight assigned to each case (respondent)
Then save and upload.
1.4: Learn More
2: Use Unique Respondent IDs
Forsta Visualizations requires that each respondent (case) ID is a unique number.
If you upload a dataset where the respondent IDs are not unique, the following validation error displays:
The following respondent IDs are duplicated: 1. Please correct the file and try again. If you need help, please contact support.
To fix the error, you can:
Use Meta data transformations to create a new Respondent ID variable
Update the Respondent ID variable as expected in the original data file
2.1: Use Meta Data transformations to create a new Respondent ID variable
To create a Respondent ID in Forsta Visualizations, open the Meta data transformations modal. Right-click any row, and select Create Respondent ID variable... from the context menu.
Note: If you are uploading multiple sets of data with the same respondents and need to track them across response waves, update the Respondent ID variable in the original data file.
2.2: Update the Respondent ID variable in the original data file
Open the data file, and look for the duplicated Respondent ID variables. In the above error, the duplicated Respondent IDs are both labeled 1. Change the Respondent ID data so each respondent (case) has a unique numeric ID. Then save and upload.
3: Create Unique Labels in Answer Blocks
Forsta Visualizations requires that each Answer text (label) in an answer block is unique.
If you upload a dataset where the Answer texts in a single answer block are not unique, a red triangle error icon shows in the Status column of the corresponding row while in the Meta data transformations modal.
To fix the error, you can:
Use Meta data transformations to rename the labels
Update the labels in the original data file
Note: If you do not fix the label, a suffix will be added to the duplicate label to differentiate it. However, if you adjust the answer group, you must manually remove duplicates as described in this section.
3.1: Use Meta Data transformations to rename the labels
In Forsta Visualizations, open the Meta data transformations modal. In the Status column, open the drop-down menu and select Errors. Or scroll down until you see the red triangle error icon on a row. Hover your mouse over the red triangle to see the error message (Answer text must be unique within question) displayed as a tool tip.
Use the blue divot to open the question and view the Answer text for the question. Hover your mouse over the red triangle to see the error message (Answer text must be unique within question) displayed as a tool tip.
In the Answer text column, rename the answer labels to be unique. The error icon will stop displaying once the error is fixed.
3.2: Update the labels in the original data file
Open the data file and rename the answer text labels to be unique. Then save and upload.
3.3: Learn More
4: Name Variables Succinctly
Forsta Visualizations requires that the variable name (question code) must be less than 50 characters.
If you upload a dataset where the variable name is more than 50 characters, the following validation error displays:
Errors for variable Edit_Your_Variable_Name_With_Too_Many_Characters_Here - ' VariableNameHasTooManyCharactersToBeUploadedAndTheLimitIs50Char' - The length of Question code cannot exceed 50 characters
To fix the error, you can:
Use Meta data transformations to rename the variable
Update the variable in the original data file
4.1: Use Meta Data transformations to rename the variable
In Forsta Visualizations, open the Meta data transformations modal. In the Status column, open the drop-down menu and select Errors. Or scroll down until you see the red triangle error icon on a row. Hover your mouse over the red triangle to see the error message (The length of Question code cannot exceed 50 characters) displayed as a tool tip.
In the Question Code column, rename the variable to have less than 50 characters. The error icon will stop displaying once the error is fixed.
4.2: Update the variable in the original data file
Open the data file and rename the variable to have less than 50 characters. In the above error, the variable is named VariableNameHasTooManyCharactersToBeUploadedAndTheLimitIs50Char and has a code of Edit_Your_Variable_Name_With_Too_Many_Characters_Here. Then save and upload.
4.3: Learn More
5: Keep Variable Types Consistent
When uploading to Forsta Visualizations, a variable cannot change its question type between uploads. For example, you cannot upload var2 as first a multi-choice question and then a single choice question.
If you upload a second dataset with the same variable name as the first dataset but the question type has changed, the following validation error displays:
Variable var2 was imported as Single choice non scale previously, but is now identified as Multiple choice which is not compatible types.
To fix the error, you can:
Use Meta data transformations to rename the variable
Update the variable name or type in the original data file
5.1: Use Meta Data transformations to rename the variable
In Forsta Visualizations, open the Meta data transformations modal. In the Question Code column, click in the Question Code field for the appropriate rows, and update the question code to be unique. In the above error, the variable with issues is named var2.
5.2: Update the variable name or type in the original data file
Open the data file, and rename the variable name to be unique. Or change the variable to be the same type of variable as in the first dataset. Then save and upload.
6: Define All Answers
Forsta Visualizations requires that all answers to categorical questions provided by a respondent are identified with a unique label (Answer text). This error is most likely to happen when paper survey answers are manually input and an answer code is not labeled.
If you upload a dataset with a variable that lacks labels for the answer option(s) selected by a respondent, the following validation error will display in the Metadata review section near the bottom of the Import data file modal after you press Upload and then Import:
The following answer alternatives do not exist in the meta data: var1-6,var1-99.
This means that the codes 6 and 99 on var1 do not have labels.
To fix the error, you can:
Exclude the answers from the import
Update the variable’s answer labels in the original data file
Note: The code 999 is not used in calculations by the system. Avoid this code for any answer alternatives you want to be part of the base. As 999 is always excluded, all answers with 999 will be always excluded.
6.1: Exclude the answers from the import
Note: Excluding answers from the import means any question with these answer codes will not be analyzed by Forsta Visualizations.
In Forsta Visualizations, open the Import data file modal. Under the Exclude Data header, add the answers listed in the error to the Exclude answers with these codes field. For the example above, enter 6,99.
Note: Including 6 means that any question with this answer code will not be analyzed by Forsta Visualizations.
6.2: Update the variable’s answer labels in the original data file
Open the data file and locate the variable. In the above error, the variable with issues is named var1. There are two unlabeled answer texts: 6 and 996. Add labels for the appropriate Answer text (code). Then save and upload.
7: Use Consistent Variable Formatting
For multiple response questions, there are very specific rules around the naming of the variables.
A multi-response question is stored as one variable per answer alternative.
The name for each variable should be formatted as Question ID + Separator + Answer ID. For example,
Q1_1,Q1_2, ...Q1_99.The separator can be any character, but the character that is chosen as the separator for multiple choice questions cannot be used in the name of any other question type. For example, in
Q1_1, the_is the separator; this means that_cannot be used in the name for a single choice question.The last instance of the separator in a question code is identified as the separator. For example, a multi-choice variable called
q1_brands_1would have a question code ofq1_brands, and the answer ID would be1.Forsta Visualizations uses the label for the first variable that belongs to the multi-response question as question text.
Each question in the multi-response question must only have the code
1as an answer alternative. That is, the value label should only contain one answer alternative with the code1as all other codes and values are treated as "Not chosen". For example, if the answer forQ1_1is "Car Brand A", the respondents that have answerd "Car Brand A" should have the code1in the data and the value label list should contain1with the label "Car Brand A.-
If you try to upload a file containing variables which are not multi-code, but containt the identified separator character in their name, the following error will display:
Errors for variable q3 - 'Likelihood to Reccomend'
- All Answer Ids must be numeric
Recc - 'Very Likely': Answer Id must be numeric
To fix the error, you can:
Use Meta data transformations to rename the variables
Update each variable’s separators in the original data file to be consistent
7.1: Use Meta Data transformations to rename the variables
In Forsta Visualizations, open the Meta data transformations modal. In the Question Code column, in the Question Code field for the appropriate rows, update the separators to be consistent. After saving the Meta data transformation, when you return to the Import data file modal, under the Multi choice question settings header, update the Multi choice question settings to match the separator you chose.
7.2: Update the variable’s separators in the original data file
Open the data file and update the separators. The content after the last instance of the separator must only contain numbers. Then save and upload.
8: Use Unique Answers for Multi-Choice Variables
Forsta Visualizations requires that the answers to each option in a multi-choice variable should be unique, and not simply Yes.
If you upload a dataset with a variable that lacks unique Answer texts for a multi-choice question, the following validation error displays:
Errors for variable var#3 - 'MC option 1' - Answer text must be unique within question 1 - 'Yes': Answer text must be unique 2 - 'Yes': Answer text must be unique 3 - 'Yes': Answer text must be unique
To fix the error, you can:
- Use Meta data transformations to rename the Answer texts
- Update the Answer texts in the original data file
8.1: Use Meta Data transformations to rename the Answer texts
In Forsta Visualizations, open the Meta data transformations modal. In the above error, the variable with duplicate answers is named var#3.
Use Ctrl + Click to select all the Question Codes associated with the multi-choice variable. In the above example, the questions codes are var#3_1, var#3_2, and var#3_3. (The initial Import data file modal identified the separator for Multi-Choice questions as _.)
Right-click one of the highlighted rows. In the context menu, select Move Question text to Answer text.
The Answer texts are now unique.
8.2: Update the Answer texts in the original data file
Open the data file and look for the multi-choice variable with duplicated answer options. In the above error, the variable with duplicate answers is named var#3. Rename the answer labels for each of its options to be unique. Then save and upload.
8.3: Learn More
9: Use the Correct Mutli-Code Separators
Forsta Visualizations requires that any content after the separator in the Question Code is numeric.
For example, if the variable is named var#3_1, you must use the _ as the separator. The # cannot be used as the separator since the answer option 3_1 has non-numeric characters.
To fix this issue:
Use Meta data transformations to reformat the variables
- Update the variable’s separators in the original data file
9.1: Use Meta data transformations to reformat the variables
In Forsta Visualizations, open the Meta data transformations modal. In the Question Code column, update each question code after the separator to be numeric.
9.2: Update the variable’s separators in the original data file
Open the data file, and update each Question Code. The content after the separator must only contain numbers. Then save and upload.