beast mode - counting text
I have a survey where the participants are able to select multiple options.
For example: Why did you decide to not enrol?
Answers: I cannot currently afford it
I am not interested
I cannot make the time
Other
When I try to visualise this, it does not group single answers with cases where there are multiple answer choices selected.
I want to be able to count each of these options.
I was trying something like the following, but it does not give me the correct counts (which I can quickly do in excel).
CASE
WHEN `Why did you decide to not enrol?` LIKE '%I cannot currently afford it%' THEN COUNT('I cannot currently afford it')
ELSE `Why did you decide to not enrol?`
End
What am I doing wrong? Or is there a better way to do this?
Thanks!
Best Answer
-
You'd need four separate beast modes to create 4 new columns to count each of the 4 individual answers. If you include the `Why did you decide to not enrol?` value itself on your chart then it will only work for that specific answer and not the entire set of answers for the question.
Can't afford example:
SUM(
CASE
WHEN `Why did you decide to not enrol?` LIKE '%I cannot currently afford it%' THEN 1
ELSE 0
END
)Not interested:
SUM(
CASE
WHEN `Why did you decide to not enrol?` LIKE '%I am not interested%' THEN 1
ELSE 0
END
)No time:
SUM(
CASE
WHEN `Why did you decide to not enrol?` LIKE '%I cannot make the time%' THEN 1
ELSE 0
END
)Other:
SUM(
CASE
WHEN `Why did you decide to not enrol?` LIKE '%Other%' THEN 1
ELSE 0
END
)**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2
Answers
-
If you want your visualisation to be one series per response choice (i.e. 4 people picked choice A and 3 people picked choice
You need to alter the granularity of your dataset from one row per question to one row per answer choice.
use the COLLAPSE function in MagicETL.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
From what I can tell collapse is for when you want to take multiple columns and make a single one.
My multiple answers are in a single column.
I have tried to filter out what I am looking for in ETL using contains and the string name.
And that works for one filter, but not if i want to filter multiple different strings and have a count of each.
I hope this makes sense. I'm very new to data analysis in this way.
0 -
You'd need four separate beast modes to create 4 new columns to count each of the 4 individual answers. If you include the `Why did you decide to not enrol?` value itself on your chart then it will only work for that specific answer and not the entire set of answers for the question.
Can't afford example:
SUM(
CASE
WHEN `Why did you decide to not enrol?` LIKE '%I cannot currently afford it%' THEN 1
ELSE 0
END
)Not interested:
SUM(
CASE
WHEN `Why did you decide to not enrol?` LIKE '%I am not interested%' THEN 1
ELSE 0
END
)No time:
SUM(
CASE
WHEN `Why did you decide to not enrol?` LIKE '%I cannot make the time%' THEN 1
ELSE 0
END
)Other:
SUM(
CASE
WHEN `Why did you decide to not enrol?` LIKE '%Other%' THEN 1
ELSE 0
END
)**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2 -
it would help if you provided a screenshot of a sample of data (column headers are most important)
and a excel mockup of what you're trying to accomplish.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
Thanks! This seems to have worked.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive