Thank for the reference, Nachiket. Unfortunately, i have already gone through this discussion and could not figure out how to fix my data specifically.
I am new to Tableau, so I may just not be understanding the solution.
Can you attach a packaged workbook? It would be difficult to identify the issue with your calculation without looking at the source data.
I cannot publish the workbook since it's tied to client personal information.
The example I provided is regarding annual household income. The variable "Income" is a continuous variable and "IncomeID" includes the answer choices, "don't know" and "Refused."
Furthermore, some other string variables that I used in a CASE statement to create the answer choice categories have the answer choices that are missing from the output because there are no clients who reported those specific answers. They are not NULL, they just do not exist in the dataset and thus are not showing up in the table.
I'd like for my output to still show in the table or graph when the answer choice was not selected at all in the data. Here is another example showing how I created the educational attainment answer choice categories, and how the answer choice "refused" does not show in the table because there aren't any clients who refused the question:
My goal is to still have the "Refused" category in the table and show zero percent.
Try creating separate calculation for each one the case and put in the Rows. You will get the title as the Refused. You wll have to make a good use of Table calculations in order to get he percentage out of it.
Please follow below example. I am using superstore for the same.
if [Category]="Furniture" THEN [Number of Records]
Create seprate calcs for Office supplies and Technology as above.
Rename the Fake calculation.
This you can do when you get measure value option. You get it when you put more that one measure and choose crosstab.
I hope this helps you in some way.
This is how my data was set up originally, but I could not produce a percent. The issues I ran into was:
- not being able to do a table calculation to run a percent total since these answer choices are now individual answer choices,
- not being able able to have the table calculation of the percent of an answer choice only show for that answer choice.
- For example: I can't make it so that the tooltip only shows the percentage for the specific answer choice instead of showing or percentage or i couldn't have two columns showing both number of records and the percentage.
Do you know how I can do this?