Creating a Beastmode that meets Revenue Requirements

Hi!
We're looking to build a beastmode that meets two requirements to then print a result. For example if a video generated more than $1K in total revenue and more than $100 during month-12, then "repost". See current beastmode below:
Background: The dataset tracks the lifespan of revenue per video title, in a 12-month period. Revenue is trended where if we posted a video in May 2022 and we're able to track how much that video generated the first month, including day 1 through day 30, the second month would include revenue from day 31 through day 60, etc.
Current beastmode:
CASE
WHEN
(MONTH(date
) = MONTH(NOW()) AND YEAR(date
) = YEAR(NOW()) AND sum(revenue
) = 0) THEN 'Repost'
WHEN
(MONTH(date
) = MONTH(NOW()) AND YEAR(date
) = YEAR(NOW()) AND sum( revenue
) < 100) THEN 'Takedown or Repost'
WHEN
(MONTH(date
) = MONTH(NOW()) AND YEAR(date
) = YEAR(NOW()) AND sum(revenue
) < 100 AND sum(revenue
) <1000) THEN 'Takedown'
ELSE 'Other'
END
Thank you!
Best Answer
-
CASE WHEN SUM(revenue) > 1000 AND SUM(CASE WHEN (`date` - DAYOFMONTH(`date`) + 1) = STR_TO_DATE(CONCAT(YEAR(NOW())-1,'-',MONTH(NOW()),'-01', '%Y-%m-%d') THEN `revenue` END) WHEN . . . END
You can try something like this to check if date is equal to 12 months ago and has 100 or more in revenue and the overall revenue is greater than 1000
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
Answers
-
CASE WHEN SUM(revenue) > 1000 AND SUM(CASE WHEN (`date` - DAYOFMONTH(`date`) + 1) = STR_TO_DATE(CONCAT(YEAR(NOW())-1,'-',MONTH(NOW()),'-01', '%Y-%m-%d') THEN `revenue` END) WHEN . . . END
You can try something like this to check if date is equal to 12 months ago and has 100 or more in revenue and the overall revenue is greater than 1000
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Thank you @GrantSmith! I will actually be testing this beastmode today! :)
0 -
Hi @GrantSmith, inspired by the beastmode you shared, any feedback on my beastmode?
Basically trying to say when the overall general revenue is greater than 1000 and month 12 revenue is less than 100 then 'XYZ'
CASE
WHEN
revenue
> 1000
AND (DATEDIFF(date
,published_date
) >329 AND DATEDIFF(date
,published_date
) <=359) < 100 THEN 'XYZ'
ELSE 'other'END
0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 656 Datasets
- 115 SQL DataFlows
- 2.2K Magic ETL
- 811 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 80 App Studio
- 45 Variables
- 771 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 77 Workflows
- 23 Code Engine
- 36 AI and Machine Learning
- 19 AI Chat
- AI Playground
- AI Projects and Models
- 17 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 142 Manage
- 138 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive