2 of 2 people found this helpful
Hi Mateusz, and welcome to Tableau and our community!
I wasn't exactly clear on how your data was laid out, but let's assume that you only have one field that contains the integer [1-5] answer. Tableau probably made this into a measure, but it's actually more like a dimension! Try clicking and dragging it from the Measures section into Dimensions. Then, drag the field (which Tableau now considers a dimension) into the columns shelf. Then, drag [Number of Records] into the rows shelf. That will probably give you what you want to see. If not, let me know!
EDIT: Just in case you don't know, numeric fields are not always measures. They can definitely be dimensions. In this case, the integer answer is more like a dimension because you wouldn't actually aggregate that number itself. That is, you wouldn't add up an answer of 3 to an answer of 4 and so on. They're more like IDs, and IDs are dimensions.
EDIT2: Also, you could treat a field in the Measure section like it's a dimension without dragging it into the Dimension half of the data panel. You would just right-click the pill in the shelf, click Dimension, then right-click again and click Discrete.
So the attached looks like what you mock up in your original question post.
In the data source, responses originally came in as a measure (green pill). I had to right click and convert to discrete. Then I used my right mouse click to drag it to the columns shelf. And then selected Response (not ATTR(Response)). See below.
Then I used my right click to drag responder to the rows shelf. I selected CNT(Responder) [You could just use Number of Records Pill to see this]. Then repeated the process to slect CNTD(Responder). Just depends if you want to count all responses per person or only the distinct names of people who responded.
Here's a screen shot of the basic result. Let me know if you have any question or need additional clarification.
Sweet, that did the trick! Thanks a bunch David, much appreciated.
I saw the intro video on the difference between dimensions and measures, but didn't realise that it would treat the data differently depending on which of those categories the fields ended up in – i thought it was just a way of sorting the fields into "most likely content" for UI purposes.
I have 4 fields in my CSV, and they all contain answers to the same question: How would you rate alternative n on a scale from 1-5? (Possible field content is null or integer 1-5)
Following your advice above I could create seperate sheets with a graph for each of these four dimensions, but thought it'd be nifty to have them on the same sheet so they'd be easier to compare. But dragging another dimension onto columns yelds the following result, and I'm curious why that happens:
Could you help me understand what Tableau is thinking here, so that I can adjust my thinking?
I would expect that the result should be something like this (mocked up in Photoshop)
If there's an order-of-things document or tutorial I ought to read to understand this better, do let me know.
1 of 1 people found this helpful
I think you would need to rearrange the data from horizontal to vertical. So you would need a general Alternative column that identifies each alt n from 1 to 4. But the below would be the result. See attached.
Good evening John,
Thanks for your input, much appreciated. Looking at your data source, yours look different than mine which migh account for why I don't get your suggestion to work.
Your exemple data is arranged like so:
User| Alternative | Rating
a | 1 | 4
a | 2 | 2
a | 3 | 4
While my data fields look like this:
User | Rating alternative 1 | Rating alternative 2 | Rating alternative 3 |
a | 4 | 2 | 4
b | 2 | 3 | 2
Should I massage the fields in the data source before I start working on them on the sheet, or how ought I to think here?
Yes I think you'll need to rearrange your data source. Typically we use SQL to manipulate ours.
I'll see if there's a way I can do something in the Tableau application a little later today.
1 of 1 people found this helpful
Okay so I think this should be easy and pretty straight forward for you. I'll step you through with screen shots below. Let me know if you have questions.
Step 1: Click on the data source tab at the bottom of the Tableau application.
Step 2: Use shift click or control click to highlight the four alt N columns (I'm not sure if Response is a separate column vs the four Alternatives - you'll need to figure out if you need to include it or not based on what your data source looks like).
Step 3: Right click on of the highlighted columns and select 'Pivot'. The data should now look like the below. You can rename the Pivot field names and Pivot field values as needed.
After some fiddling, that worked a treat. Thanks a lot for your help John!