Count Based on Unique Identifier
Hello all,
I'm very new to Domo and in particular Beastmode.
In this case, I do not have access to the dataflow behind the chart.
I'm trying to count the number of yes and no responses for each unique ID number to put into a stacked bar chart. My X-Axis is the person and the Y Axis is the total number of unique items stacked by Yes/NO. The same ID will never have a Yes and No. The response will always be the same for each ID, but the ID could be listed many times. Sample data below:
ID | Person | Response |
1 | John | Yes |
1 | John | Yes |
2 | Paul | No |
3 | Paul | Yes |
4 | Paul | No |
4 | Paul | No |
Desired Output | YES | NO |
John | 1 | |
Paul | 1 | 2 |
Any help would be greatly appreciated.
Thank you.
Best Answer
-
VRIndy,
To get a unique count based on the ID and Person, I believe the following should work for you. Here is the BeastMode I used in testing:
COUNT(DISTINCT CONCAT(`ID`,`Person`))
And here is a screenshot of the setup/results:
This seems to capture what you're looking for. If not, please let me know how I can help further.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the thumbs up if this post helped you.1
Answers
-
VRIndy,
To get a unique count based on the ID and Person, I believe the following should work for you. Here is the BeastMode I used in testing:
COUNT(DISTINCT CONCAT(`ID`,`Person`))
And here is a screenshot of the setup/results:
This seems to capture what you're looking for. If not, please let me know how I can help further.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the thumbs up if this post helped you.1 -
Thank you. This worked with one exception. It is showing 1 more response that actual unique id's. Not sure why. I've actually manually counted the data and the unique id count is correct. Any ideas?
0 -
Is it possible that you have either an ID or Person with either a leading or trailing space or some other character?
Is it 1 additional count for every unique ID or for only 1 person?
0 -
I've exported the data to excel and used sumproduct to count unique values by id and then concatentated the id with the yes/no and the persons name. Shows 26 in the id column and 27 in the concatentated column. It has to be something in the data. I will keep trying to determine the problem.
The bottom line is the Beastmode formula worked! Thank you I will mark it approved!
0 -
For some reason my beast mode is not recognizing the concat command. Can you screen shot what your beastmode looks like in the screen?
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive