How to have a static number in beast mode
I have a table of categories with corresponding category path and visitors. Like the table below:
ID | Category Name | Category Path | Visitors | % Seg |
123 | A Airlines | Travel and Tourism -> In-Market -> Airlines | 1000 | 100/10000 |
124 | B Airlines | Travel and Tourism -> In-Market -> Airlines | 1500 | 1500/10000 |
125 | C Airlines | Travel and Tourism -> In-Market -> Airlines | 2000 | 2000/10000 |
126 | D Airlines | Travel and Tourism -> In-Market -> Airlines | 2500 | 2500/10000 |
200 | In-Market | Travel and Tourism | 10000 |
I need to create a "% of Segment" beast mode, whose calculation is Visitor (for each airline)/ Visitor (In-market), so I need my denominator to be static - 100000 - in the beast mode. The beast mode I'm having right now is `Visitor`/(case when `ID`=200 then `Visitor` end), which doesn't work. How can I have that number other than manually typing in?
Thank you for any idea on how to solve it!
Comments
-
You'd need, at the very minimum, a window function for that kind of math. I don't think these are officially supported by Domo for Beast Modes (they are in data flows), so your mileage may vary.
To get your denominator it would be something like sum(`visitors`) over (partition by `category path`)
Help link: https://dev.mysql.com/doc/refman/8.0/en/window-functions-usage.html
You appear to have the added complexity of extracting category values from your category path column, so that may make things more difficult if you want to get those exact elements as shown here.
Hopefully this gives you some direction. Let us know if you need more help.
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Hi Aaron,
Thank you for the idea! However, the visitor for "In-Market" is not the sum of other rows, which is why I need to use that exact cell value, so I don't think I can use the function you suggested.
The reason why I didn't do these calculations in data flows is because the denominators for the different categories vary, which depend on the categories filtered in the cards. If there is no available function in beast modes, I will just manully type in. Thank you!!!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive