Force Pie Chart to show data for only most recent day of date range
I have a dataset that has the following columns: Date, Store, Plan, Total. My users want a pie chart that shows the total for each plan type on the last day of whatever date range the filters set, i.e.: if today is the 24th and the filter is set to month to date, I want only the values for the 24th. Unfortunately, no matter what I do I end up with the total across all dates in the date range. I've tried the date in the filter, but it only lets me choose a specific date, not the max date in the range. I tried to make a beast mode that set a flag to 1 if the date was equal to the max of the date range (CASE WHEN `Date` = MAX(`Date`) THEN 1 ELSE 0 END), but when I put the data into a table the flag was 1 for all dates in the range, so I'm obviously doing something wrong there. Can anyone give me a pointer in the right direction?
Answers
-
So you have the right idea with your case statement, but that statement executes on a row by row basis, so it's only comparing the date of the row to the MAX(Date) of each row.
Add a MaxDate in the dataflow and then do that comparison there.
0 -
If I'm understanding, I'm not sure how this would work: my users might set the dashboard's date filter to month to date, or to previous month, or to previous year, or any of a hundred other ranges, and I can't account for each of those in the flow itself. Is there no way in a beast mode to get the max value across all rows allowed by the date filter, and then use that value?
0 -
You can try and use a beast mode with a fixed function and filter on that beast mode:
CASE WHEN `dt` = MAX(MAX(`dt`)) FIXED () THEN 'Latest' ELSE 'Not' END
This example uses a dt date field but you can then put this into the filter and filter for "Latest"
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
I agree with @GrantSmith here. By using a fixed function, you should be able to check each date against all other dates coming through the filters. I would be curious to hear if this didn't work.
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
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 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