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.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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 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