Download the Tableau Workbook below that includes data from the 2023 National Survey of Children’s Health. Here is a link to information about the dataset: Link to information about variables
1
www2.census.gov/programs-surveys/nsch/technical-documentation/codebook/2023-NSCH-Screener-Variable-List.pdf
Let’s look at the proportion of children who need or currently take medication, which is labeled “C_K2Q10”. We want to find the number of responses with a “1” and divide by the total number of responses.
We’ve practiced doing things like this in Excel, but Tableau is a little different.
Use ChatGPT or Copilot and ask “If I have a variable labeled C_K2Q10, how would I calculate the proportion of responses that were a “1” in a calculated field in Tableau?”
Check to see if you get the answer below, and then create this calculated field in Tableau.
Answer.
SUM(IF [C K2Q10]=1 THEN 1 ELSE 0 END)/COUNT([C K2Q10])