Vars to cases & retain variable/value labels Tableau setup - restructure data for Tableau, flip data

前端 未结 2 546
粉色の甜心
粉色の甜心 2021-01-16 10:35

I am flipping my survey data so I can use it in Tableau. Here is example data in SPSS (keep in mind that each variable has value & variable labels).

ID          


        
2条回答
  •  春和景丽
    2021-01-16 11:25

    you need to use OMS to read the dictionary into two datasets - one for variable labels and one for value labels. then you can match your restructured dataset to the variable labels by variable name, and then match it to the value labels by variable name and value.

    Run this to get the two datasets - BEFORE you restructure, of course:

    DATASET DECLARE  varlab.
    OMS   /SELECT TABLES   /IF COMMANDS=['File Information'] SUBTYPES=['Variable Information']
      /DESTINATION FORMAT=SAV OUTFILE='varlab' VIEWER=YES.
    DATASET DECLARE  vallab.
    OMS  /SELECT TABLES   /IF COMMANDS=['File Information'] SUBTYPES=['Variable Values']
      /DESTINATION FORMAT=SAV OUTFILE='vallab' VIEWER=YES.
    display dictionary.
    omsend.
    

    now restructure and match files - (after renaming the proper variables for matching in the two new datasets).

提交回复
热议问题