5 Replies Latest reply on Nov 18, 2013 10:36 AM by Alex Kerin

    Questionnaire / Survey Data and Calculations

    kevin.robell

      I am very new to Tableau and wondered if anyone had some feedback for me in this regard. I have a large questionnaire that I was originally working with in Tableau that was structured in a way that each question was a column and the answers, mostly (Y,N, free text,) were records. Under this format I have been running into some issues analyzing multiple answer questions (i.e. past sports) with a single answer question (current sport) as a filter - What is the variety of past sports of people who currently play lacrosse. With some helpful feedback on another feed, I cleaned up in Excel using the Tableau "Reshaping" add-in. Now that the data is ordered with both question and answer as dimensions I feel things to be "backwards" compared to how the data was originally ordered. I am trying to aggregate answers that used to be measure but now are a dimension. Obviously this new "Answer" dimension is a string of all different formats of answers (Y,N,free text fields, height, weight, past sports, etc.). How do I create measures for these answers out of this dimension now that the Add-in consolidated these answers in one column. I tried to a calculation but cannot filter to the particular answer (i.e avg height) that I wish to aggregate.

       

      I am still learning the Tableau language so I apologize if I sound a bit elementary or confusing. I appreciate any feedback.

       

      Kevin

        • 1. Re: Questionnaire / Survey Data and Calculations
          Jonathan Drummey

          Hi Kevin,

           

          What I've done with my survey data (HCAHPS and CGCAHPS) is to have an associated dimension table that indicates the type of question (Likert Scale, Yes/No, etc.). The query that is used as the Tableau data source joins to the dimension table to get the Question Type, then I have calculated fields that do whatever is necessary for that question type.

           

          Also, if you haven't seen Steve Wexler's series of posts on analyzing survey data with Tableau at Data Revelations | Visualizing Survey Data, they are a tremendous resource.

          • 2. Re: Questionnaire / Survey Data and Calculations
            Alex Kerin

            I like that idea of the dimension table Jonathon, especially if it also held question number (it they are not in the survey). Otherwise you end up with an alphabetical list of questions.

             

            Ditto on the 4 part series by Steve W - very good indeed.

            • 3. Re: Questionnaire / Survey Data and Calculations
              Susan Baier

              Hi Kevin,

               

              I see you've gotten some good suggestions already. I convert responses on questions where I'm going to need to do multiple analysis into numbers before reshaping -- then I create  "Response" table that provides aliases for numeric responses that represent a test answer (i.e. "all the time", "lacrosse", etc.). That way I can work with the data in multiple ways because it's all numeric.

              • 4. Re: Questionnaire / Survey Data and Calculations
                Alex Kerin

                I kind of get round that by including a number as part of the likert answers, then using a calc to pull that out. This calc also allows for yes/no answers:

                 

                Float(

                    if Left([Response],3) = "Yes" then str([Likert Center (if even responses, will be x.5)]+1)

                        elseif Left([Response],2) = "No" and len([Response])=2 Then str([Likert Center (if even responses, will be x.5)]-1)

                            elseif Left([Response],3) = "Not" then str([Likert Center (if even responses, will be x.5)])     

                                elseif [Response] ="1st" then "3"

                                elseif [Response] ="2nd" then "2"

                                elseif [Response] ="3rd" then "1"

                                   elseif mid([Response],2,1)="0" or mid([Response],2,1) = " " then Left([Response],2)  

                    else Left([Response],1) end

                )

                • 5. Re: Questionnaire / Survey Data and Calculations
                  Alex Kerin

                  I will also create custom calcs for individual questions.