Arbitrary Periods as Pivot Table Columns
I'm trying to build out a pivot table card and I'd like to use some arbitrary time periods for the columns. This Week, Last Week, Month to Date, Year to Date. I'm not sure how/where to define these periods so I can use them in the pivot table to both use them as labels for the columns but also to then use them to do the value aggregations correctly as well.
Can someone point me in the right direction?
Comments
-
@WillClark My company has a card that does something similar with YTD, MTD, last week, etc. You'll need to write a beast mode for each time period you want to calculate, and use the current date to determine what gets included. A YTD beast mode would look something like this:
case when YEAR('date') = YEAR((date(CONVERT_TZ( now() , 'GMT','your_timezone'))) then 'Amount' end
Then when you add your column just set it to the desired aggregation. Then you'll just go through use the available date functions in Domo to do the comparisons with the current date for the rest of your time periods:
- MTD: mm/yyyy of 'date' = mm/yyyy of current date
- This week: ww/yyyy of 'date' = ww/yyyy of current date
- Last week: ww/yyyy of 'date' + 1 week = ww/yyyy of current date
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
2
Categories
- 7.7K All Categories
- 3 Connect
- 919 Connectors
- 244 Workbench
- 477 Transform
- 1.8K Magic ETL
- 60 SQL DataFlows
- 446 Datasets
- 38 Visualize
- 198 Beast Mode
- 2K Charting
- 8 Variables
- 1 Automate
- 348 APIs & Domo Developer
- 82 Apps
- Workflows
- 14 Predict
- 3 Jupyter Workspaces
- 11 R & Python Tiles
- 241 Distribute
- 59 Domo Everywhere
- 241 Scheduled Reports
- 15 Manage
- 36 Governance & Security
- 27 Product Ideas
- 1.1K Ideas Exchange
- Community Forums
- 14 Getting Started
- 1 Community Member Introductions
- 49 Community News
- 18 Event Recordings
- 579 日本支部