Case statement in beast mode
Hi,
I have five columns in the dataset named Product1, Product2, Product3, Product4, and Product5.
I want to find out how many products have been sold in 1 transaction. All columns have value 'Y' and 'N'.
To find out the combinations of 2 products bundle, I am using:
(case when
(`Product1` = 'Y' and `Product2` = 'Y') or
(`Product1` = 'Y' and `Product3` = 'Y') or
(`Product1` = 'Y' and `Product4` = 'Y') or
(`Product1` = 'Y' and `Product5` = 'Y') or
(`Product2` = 'Y' and `Product3` = 'Y') or
(`Product2` = 'Y' and `Product4` = 'Y') or
(`Product2` = 'Y' and `Product5` = 'Y') or
(`Product3` = 'Y' and `Product4` = 'Y') or
(`Product3` = 'Y' and `Product5` = 'Y') or
(`Product4` = 'Y' and `Product5` = 'Y')
then 1
end
)
Then I am taking the count of that. The resulting number is more than what it should be.
Any help will be appreciated.
Thanks
Categories
- All Categories
- 1.2K Product Ideas
- 1.2K Ideas Exchange
- 1.3K Connect
- 1.1K Connectors
- 273 Workbench
- 2 Cloud Amplifier
- 3 Federated
- 2.7K Transform
- 78 SQL DataFlows
- 525 Datasets
- 2.1K Magic ETL
- 2.9K Visualize
- 2.2K Charting
- 434 Beast Mode
- 22 Variables
- 511 Automate
- 114 Apps
- 389 APIs & Domo Developer
- 8 Workflows
- 26 Predict
- 10 Jupyter Workspaces
- 16 R & Python Tiles
- 332 Distribute
- 77 Domo Everywhere
- 255 Scheduled Reports
- 66 Manage
- 66 Governance & Security
- 1 Product Release Questions
- Community Forums
- 40 Getting Started
- 26 Community Member Introductions
- 68 Community Announcements
- 4.8K Archive