Calculating Attach Rate - when product B is on a transaction that also has product A

Hi experts.
I have a set of sales data where each product has a row for the number of units sold on each Sales Order.
I want to calculate the Attach Rate - where Product Type B was sold in a transaction that also had Product Type A.
So in the example below there were 4 transactions where Product A was sold, and in 2 of them, Product B was also sold. So the Attach Rate would be 50%.
Is there a way to calculate this in a Beast Mode? I have tried a few things but think I might be going about it the wrong way.
Answers
-
There might be a way to do this with a fixed function beast mode, but I'm not sure how at the moment. I'll give it a shot and update if I can figure something out.
However, if I had to do this, I would probably do something in Magic ETL to unpivot the products so that I had one row per order and then a column for each product, so then I could compare the products per order across the row. Another route would be to concatenate the products that were purchased, but it's the same concept - getting all of the products purchased onto the same row. Then I would build a beast mode to look for sales for product A, and any rows that had sales for product A and product B.
0 -
Sorry If I've taken this too literally - this solution may not work if you have a lot of different products that you're trying to find attach rates for. I did get it to somewhat work with a couple of fixed function beast modes, though it's not an ideal solution.
First, I made a beast mode that looked for orders that include product A: max(max(distinct case when
Product
= 'A' then 'Y' else 'N' end) fixed (byID
)). I used this to filter on 'Y'.Then, I made an 'Attach Rate' metric: sum(count(distinct case when
Product
= 'B' thenID
end) fixed (byID
filter allowProduct A filter
))/COUNT(DISTINCT case whenProduct
= 'A' thenID
end)This method only worked, however, if I kept the order IDs in the card:
If I removed the IDs, it looked like this:
Maybe someone with better fixed calc skills can get this over the finish line for you.
0 -
Thanks Sean. I had tried something similar to what you tried with a beast mode, but was not quite getting the results. I definitely need it to not have the ID in the card as I need to show the overall Attach Rate.
I'm think I'm going to have to go the ETL route.
Thank again for having a go.
1
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Connect
- 1.3K Connectors
- 309 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 663 Datasets
- 119 SQL DataFlows
- 2.3K Magic ETL
- 823 Beast Mode
- Visualize
- 2.6K Charting
- 86 App Studio
- 46 Variables
- Automate
- 193 Apps
- 483 APIs & Domo Developer
- 87 Workflows
- 23 Code Engine
- AI and Machine Learning
- 23 AI Chat
- 4 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 117 Domo Everywhere
- 283 Scheduled Reports
- 11 Software Integrations
- Manage
- 143 Governance & Security
- 11 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 116 Community Announcements
- 5K Archive