How to treat checkboxes type of question on metabase

Written by Impact Atlas
Updated 1 year ago

The checkboxes is one of the most used type of question when you want to allow the participant to mark more than one answer option. However, all the selected answers come together in the database and sometimes it requires a bit of treatment to be able to create meaningful visualizations.

This article is going to show you step by step on how you can manipulate the data on metabase to create clean visualizations.

You can see below an example of checkboxes type of question and how it looks like if you create a visualization without and with data treatment:

Database:

Visualization without data treatment:

Visualization with data treatment:

Step by step on how to treat checkboxes type of question on metabase:

The first thing you need to have is all the answer options of the question you want to treat. You can download your survey and have it on a excel, for example:

On metabase home page, click on "New" button on the top right and select "SQL query":

Select the corresponding cohort:

Then, enter the code below and replace the bold information by the actual data as the example:

Code
select count(*), "answer label" from survey name where `question number_question label` like '%answer label%'
union
select count(*), "answer label" from survey name where `question number_question label` like '%answer label%'

Once you are done editing the code, click on the play button to see how the data will be displayed:

Click on "Visualizations" and select the type of graphic or table you want. You can edit and customize it as you wish and once you are done, click on the "Save" button on the top right:

Name and save it. You can either immediately add it into a dashboard or do it later:

Did this answer your question?