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
- Product Ideas
- 2.1K Ideas Exchange
- Connect
- 1.3K Connectors
- 309 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 664 Datasets
- 120 SQL DataFlows
- 2.3K Magic ETL
- 825 Beast Mode
- Visualize
- 2.6K Charting
- 88 App Studio
- 46 Variables
- Automate
- 196 Apps
- 486 APIs & Domo Developer
- 94 Workflows
- 24 Code Engine
- AI and Machine Learning
- 23 AI Chat
- 4 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 119 Domo Everywhere
- 283 Scheduled Reports
- 11 Software Integrations
- Manage
- 143 Governance & Security
- 11 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 116 Community Announcements
- 5K Archive