Complex count distinct

NathanDorsch
Member
in Charting
I have a dataset with session IDs and pages... I want to know how many distinct session IDs include a specific page ('ABC'). The trick is one session ID could have multiple rows with page ABC...
Session ID -- Page
123 -- ABC
123 -- ABC
123 -- DEF
456 -- DEF
456 -- ABC
789 -- GHI
Hypothetically, how do I create a beastmode to count distinct session IDs with ABC as 2?
0
Best Answer
-
Have you tried this:
COUNT(DISTINCT CASE WHEN `pageid` = 'ABC' then `sessionid`end )
This should do it
**Check out my Domo Tips & Tricks Videos
**Make sure toany users posts that helped you.
**Please mark as accepted the ones who solved your issue.0
Answers
-
Have you tried this:
COUNT(DISTINCT CASE WHEN `pageid` = 'ABC' then `sessionid`end )
This should do it
**Check out my Domo Tips & Tricks Videos
**Make sure toany users posts that helped you.
**Please mark as accepted the ones who solved your issue.0
Categories
- 10.5K All Categories
- 8 Connect
- 918 Connectors
- 250 Workbench
- 470 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 477 Datasets
- 195 Visualize
- 253 Beast Mode
- 2.1K Charting
- 11 Variables
- 17 Automate
- 354 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 247 Distribute
- 63 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 175 Product Ideas
- 1.2K Ideas Exchange
- 12 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive