tableau-desktop

How can I match up rows with columns in Tableau?


I have a Tableau report that is using data from an MySQL database. The query is just a select statement that returns all the rows for an exam.

In Columns, I have the QuestionText which looks fine.

In Rows, I have studentLastName but now I want to show the answer each user selected for each question.

But whenever I drag the studentAnswer column over to a row, it shows the selected answer for every question...but I only want to show the answer for the question that is for that column.

For example, if I have the following questions in the columns:

"What color is on the screen?" | "How old is your instructor?" | "What month is it?"

When I drag the studentAnswer over to a row, it does this:

"What color is on the screen?"  |  "What day is it?"  |  "What month is it?"

Blue  Monday   May                Blue  Monday  May     Blue  Monday  May 

Is there a way to fix this?

thanks!


Solution

  • Try these two fixes first:

    1. Bring studentAnswer to Text in the "Marks Pane" while leaving QuestionText and studentLastName in their respective places

    2. If you just want a grid similar to your select query, bring all your fields to rows and sort as you need fit.

    If these don't resolve it, I think something funky may be happening in your SQL script were each answer is linked to each question.