Can I dynamically group data to two periods (Current 12 month and Prior 12 months) ?
Can I dynamically group data to two periods (Current 12 month and Prior 12 months) using window function so I can select time periods to compare. Client wants to be able to select months in the past and compare rolling 12 month as of the last date select date.
I tried this formula for Current period, but it doesn't aggregate all the way.
case when dense_rank() over (order by `Posting Period` desc) <=12 then sum(`Payment Amount`*-1) end
When I remove Posting Period column from the table, the Current Period Payments column doesn't aggregate and remains the same. i want to be able to add Prior 12 months data Next to Current.
Answers
-
I would suggest you look at these two posts on creating these if you are wanting to display as table cards:
https://dojo.domo.com/discussion/52681/domo-ideas-conference-beast-modes-running-totals#latest
https://dojo.domo.com/discussion/52679/domo-ideas-conference-beast-modes-rolling-averages#latest
If you can display this information as a bar+line graph, I would suggest you use the period over period cards and select last 24 months in your date range filter and group by month and compare to 12 months prior. This would not require any beast mode work and would let you see how a month compared to the same month in the prior year.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
Thank you, Mark. I will try rolling summaries. I do need it in the table cards.
0 -
I’d recommend using a date dimension with custom defined offsets. Using the custom date offset dimension you can have the current value and the value from 12 months ago. This will simplify your graphing and correctly calculate the current month to the partial month from the previous period . I’ve done a Previous write up here: https://dojo.domo.com/discussion/53481/a-more-flexible-way-to-do-period-over-period-comparisons#latest
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thank you for reminding about this, Grant! And, if they want to choose 12 months to compare to the previous time period, they could do it by using Date page filter or calendar filter card, right?
0 -
Yeah, it'll automatically filter based on the date or card filters, the period offset won't be able to change but the timeframe they're looking at can. You can always define additional offsets if necessary.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**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
- 101 SQL DataFlows
- 622 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 748 Beast Mode
- 59 App Studio
- 41 Variables
- 686 Automate
- 176 Apps
- 453 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 396 Distribute
- 113 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 125 Manage
- 122 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 109 Community Announcements
- 4.8K Archive