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.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
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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