Summing by groups in beast mode?
I'm running on 2 hours of sleep so I think I am just overthinking this right now but I essentially have a large dataset of event attendance by members
Here is a sample of my data:
Event Date | Event Name | Member ID | Member is Registered for Event | Parent Group | Location Type |
---|---|---|---|---|---|
Apr-25 | Event 1 | 1 | 0 | Primary | Primary |
Apr-25 | Event 1 | 2 | 1 | Primary | Primary |
Apr-25 | Event 1 | 3 | 0 | Primary | Primary |
Apr-25 | Event 1 | 4 | 0 | Primary | Primary |
Apr-25 | Event 1 | 5 | 1 | Primary | Primary |
Sep-24 | Event 2 | 1 | 1 | Primary | Primary |
Sep-24 | Event 2 | 2 | 1 | Primary | Primary |
Sep-24 | Event 2 | 3 | 0 | Primary | Primary |
Sep-24 | Event 2 | 4 | 1 | Primary | Primary |
Sep-24 | Event 2 | 5 | 0 | Primary | Primary |
Apr-23 | Event 3 | 1 | 1 | Primary | Primary |
Apr-23 | Event 3 | 2 | 1 | Primary | Primary |
Apr-23 | Event 3 | 3 | 0 | Primary | Primary |
Apr-23 | Event 3 | 4 | 1 | Primary | Primary |
Apr-23 | Event 3 | 5 | 1 | Primary | Primary |
But as you can see the member ID is going to repeat for every single event so its producing 40000 instances instead of 200 out of 1200 possible members for this event and 450 out of 1200 possible members for this event didnt attend.
I know I can pivot table this to count how many are 0, but is there a way to incorporate this into metrics too? Im hoping to create this in a card level since its coming from a federated source
Or like these metrics/table
People who have never attended an event
1
or
People who havent attended an event in the last year
3
or
Event Name | People that did not attend but could have | People that attended |
---|---|---|
Event 1 | 3 | 2 |
Event 2 | 2 | 3 |
Event 3 | 1 | 4 |
Best Answer
-
Hi @deona720
In order to solve this I'd recommend creating the following beast modes:
- Member Count
COUNT(DISTINCT `Member ID`)
- People That Attended
IFNULL(COUNT(DISTINCT CASE WHEN `Member Is Registered for Event` = 1 THEN `Member ID` END ),0)
- People Who Have Never Attended an Event
— This beast mode subtracts People That Attended from Member Count to get the count of non-attendees `Member Count` - `People That Attended`
And then you can use these beast modes to answer your questions:
0
Answers
-
Hi @deona720
In order to solve this I'd recommend creating the following beast modes:
- Member Count
COUNT(DISTINCT `Member ID`)
- People That Attended
IFNULL(COUNT(DISTINCT CASE WHEN `Member Is Registered for Event` = 1 THEN `Member ID` END ),0)
- People Who Have Never Attended an Event
— This beast mode subtracts People That Attended from Member Count to get the count of non-attendees `Member Count` - `People That Attended`
And then you can use these beast modes to answer your questions:
0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 308 Workbench
- 6 Cloud Amplifier
- 10 Federated
- 3.8K Transform
- 660 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 815 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 84 App Studio
- 46 Variables
- 780 Automate
- 191 Apps
- 482 APIs & Domo Developer
- 84 Workflows
- 23 Code Engine
- 41 AI and Machine Learning
- 21 AI Chat
- 2 AI Projects and Models
- 18 Jupyter Workspaces
- 414 Distribute
- 122 Domo Everywhere
- 281 Scheduled Reports
- 11 Software Integrations
- 146 Manage
- 142 Governance & Security
- 8 Domo Community Gallery
- 49 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 4.8K Archive