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
- 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.8K Visualize
- 2.5K Charting
- 737 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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