How to Get Quarterly Trend Numbers
I think this is a pretty basic question. I am trying to create a card that shows our quarterly trend for revenue. Ideally I would do this through the formula ('Revenue' / DayofQuarter). Unfortunately, while there is a DayofWeek, DayofMonth, and DayofYear function, there is no formula for DayofQuarter. Thoughts on how I make this work?
0
Comments
-
Hi @cjones
An example of BEAST MODE or DataFlow SQL.
-- DayOfQuarter
case
when month(`Date`) <= 3 then datediff(`Date`, concat(year(`Date`),'-01-01'))
when month(`Date`) <= 6 then datediff(`Date`, concat(year(`Date`),'-04-01'))
when month(`Date`) <= 9 then datediff(`Date`, concat(year(`Date`),'-07-01'))
else datediff(`Date`, concat(year(`Date`),'-10-01'))
endor
-- DayOfQuarter
case
when month(`Date`) <= 3 then datediff(`Date`, concat(year(`Date`),'-01-01')) + 1
when month(`Date`) <= 6 then datediff(`Date`, concat(year(`Date`),'-04-01')) + 1
when month(`Date`) <= 9 then datediff(`Date`, concat(year(`Date`),'-07-01')) + 1
else datediff(`Date`, concat(year(`Date`),'-10-01')) + 1
end0
Categories
- All Categories
- 1.4K Product Ideas
- 1.4K Ideas Exchange
- 1.4K Connect
- 1.2K Connectors
- 284 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.9K Transform
- 89 SQL DataFlows
- 556 Datasets
- 2.2K Magic ETL
- 3.3K Visualize
- 2.3K Charting
- 569 Beast Mode
- 10 App Studio
- 27 Variables
- 578 Automate
- 140 Apps
- 414 APIs & Domo Developer
- 23 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 350 Distribute
- 90 Domo Everywhere
- 258 Scheduled Reports
- 2 Software Integrations
- 92 Manage
- 89 Governance & Security
- 9 Product Release Questions
- Community Forums
- 42 Getting Started
- 28 Community Member Introductions
- 85 Community Announcements
- 4.8K Archive