1) Drag the response field to filter and select "Yes","No"
2) Again drag the response filed to columns
3) Drag the Number of records to rows
4) Right click on SUM(NUMBER OF RECORDS) --> Quick Table calculation --> Percent of Total
5) On the top of the menu bar, you can see "T" symbol click on it you will get the text value
now your view will show a bar graph with yes and no percentages
Hope this helps kindly mark this answer as correct or helpful so that it will help others
Adding to Naveen's comment.....
Depending on your dataset, SUM(Number of Records) may give you the wrong results if you have duplicates in your data.
If there is a field called Question ID, Response ID or any other relevant unique ID field in you dataset, you can use them instead of Number of Records. For example, use COUNTD(Response ID) or COUNTD(Question ID).
Yeah, the sum(number of records) won't work because there's a lot of garbage in the dataset that I can't remove, and there's no unique Response ID field that's going to help me.
If I use basic maths, perhaps someone can suggest a formula.
x = number of yes's in the field
y = number of no's in the field
x ratio = (x / total)*100
y ratio = (y / total) *100
Then I just need a bar charts showing x and y on the same bar, both adding up to 100.
Any suggestions there?
I think next step might be to post the dataset to this thread...
Yes, that's correct and should give you same results as Naveen's approach.
The only to bear in mind is that number of yes's or no's will still be the same as the number of records. If I may ask, what is it that uniquely identifies a question or a row in your database?
Please go ahead and post some dataset, it will be good to take a look.
How do I attach a file to this forum thread?
Hmm, when I hit reply there is no "advanced editor and add an attachment" button in the reply layout...
May be this feature has been removed?
Here's the file with the data below:
You can see from the worksheet, I've got a chart showing yes/no count against each category. Instead of showing a toal for each, I'd like a ration for each out of 100. For example, hazardous chemicals would be 92% yes, 8% no.
Against each category I'd like to see a bar up to 100, with a % of yes/no.
You attached the twbx with tableau online connection extract the local copy of the data and re attach again
Unable to see the data in your attached workbook
1 of 1 people found this helpful
You can create the bar charts in different formats. Below is an example with 100% horizontal bar chart.
Duplicate Sheet 1 and transpose the chart. Right click on CNT(Response (copy)), under 'Quick Table Calculation', select 'Percent of Total'. Under 'Compute Using..', select 'Table Across'.
For the vertical bars, select 'Table Down' under 'Compute Using'.
Hope this helps.
Thanks so much Ossai!
That's exactly what I was looking for, so simple!
You're welcome Eugene. Could you please mark my answer as correct?