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.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive