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
- 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
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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