Survey - Count the answers.

If I have a survey and user can choose multiple answers and also have the choice to write.

How can I count every option that the user has selected.


Results should be like this.

Red 3

Blue 2

Green 1

Orange 1

Pink 1

Yellow 1

Best Answers

  • MarkSnodgrass
    Answer ✓

    You can separate the multiple answers out into separate columns using the Split Column tile in Magic ETL. You would need to use multiple tiles to account for the maximum number of answers that a person might have selected. Once they are all separated, I would recommend adding an Unpivot tile so that you have a single column called answer and if a person had selected 3 colors, it would result in 3 rows, one for each answer. It is then very easy to count the results.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • MarkSnodgrass
    Answer ✓

    You could do a case statement to look for each color in the string, but I think you will need to create a beast mode for each color. For example, the red beast mode would look like this

    (CASE when `String` LIKE '%Red%' THEN 1 ELSE 0  END)
    

    Blue would look like this

    (CASE when `String` LIKE '%Blue%' THEN 1 ELSE 0  END)
    

    You can then put each of these beast modes into your card and sum them each to get the total counts.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.

Answers

  • MarkSnodgrass
    Answer ✓

    You can separate the multiple answers out into separate columns using the Split Column tile in Magic ETL. You would need to use multiple tiles to account for the maximum number of answers that a person might have selected. Once they are all separated, I would recommend adding an Unpivot tile so that you have a single column called answer and if a person had selected 3 colors, it would result in 3 rows, one for each answer. It is then very easy to count the results.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • I was trying not to do in ETL but in beast mode.

    Seems like that would be the way to go, thanks.

  • MarkSnodgrass
    Answer ✓

    You could do a case statement to look for each color in the string, but I think you will need to create a beast mode for each color. For example, the red beast mode would look like this

    (CASE when `String` LIKE '%Red%' THEN 1 ELSE 0  END)
    

    Blue would look like this

    (CASE when `String` LIKE '%Blue%' THEN 1 ELSE 0  END)
    

    You can then put each of these beast modes into your card and sum them each to get the total counts.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Thank you!