Transforming Date Range to Zero
I have a simple dataset that has activities over time. I like to break that down by week so I can see the week to week workload of the team. For some of the activities being tracked in the data there might not be anything so in my line chart it shows as a blank and the line graph breaks. I've looked at "hide empty values" but that connects one point to the next rather than dropping it back down to zero. Is there a beast mode function I can write that would say for for this week, if null (no values time period) then 0 else count however many there actually were? You can see no activity between week 4 and 6 for the red series. no activity between week 7 and 9 on the green series. etc... how to I drop those to zero?
Answers
-
You'll need to utilize a calendar dimension dataset. Domo has one in the Domo Dimensions connector (calendar.csv). This has all the dates from 2010-2030. I'd recommend filtering the dataset to be before the current date and after or equal to the start date of your data. This will reduce the extra rows which won't be helpful to you. Start with this in your ETL and then LEFT join your data to it. This will cause all of the dates to be populated, however because you're doing a left join the values will be null. You can use a formula tile and then alter your count field with COALESCE:
COALESCE(`Amount`, 0)
This will default the values to 0 to force them to show up on your card.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 98 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 713 Beast Mode
- 50 App Studio
- 39 Variables
- 669 Automate
- 170 Apps
- 447 APIs & Domo Developer
- 45 Workflows
- 7 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 116 Manage
- 113 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 104 Community Announcements
- 4.8K Archive