Adding Missing dates between start and end date for each category
Hello, I am trying to add missing dates from Start and End date for each category in Magic ETL. I tried to bring in Domo Calendar but confusion is what column from my dataset should I join with Cal.dt? Should that be start date or end date? Also, Then how would I create an output column which will have start date, missing dates and end date all in one col for each category. for eg:
Output requirement is
Comments
-
You are on the right track using the Domo Calendar. What you need to do is an Add Constant tile after each dataset and create a column such as JoinCol and assign a value of 1 to each. Then join the two datasets on that column, using a left join of the calendar so that you get all the dates. If you are just wanting the first day of each month from the calendar dataset, you can filter before the join to where day = 1.
Here's an example of what the ETL would look like.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.3 -
Thanks @MarkSnodgrass.
0 -
I need urgent solution for this issue. I tried to implement above solution of joining Domo Calendar but now I am losing all rows which are not matched with start and end date.
Currently, I am getting all matched rows
I want to get all missing weeks as well. The result dataset should be something like following table. All highlighted rows are missing in my output.
Can anyone help me what should I do?
0 -
@User2021 did you apply any filtering to the calendar dataset prior to joining with your main dataset? Also, make sure your join criteria only includes the key column. Don't add any other columns to your join criteria.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2 -
No filters and it is joining on one date column. Which is the tbl.sales date = cal.dt
0 -
I am doing outer join to bring all cal dates in. I do get it but then when I filter by key, I lose all extra(added) rows of dates.
0 -
Ok. In your case, I would suggest a Left Outer Join and make the calendar the left table. This will give you a row for every day and your sales date will have a value when there is a match. You actually won't need that constant field that I described earlier.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.3 -
Exactly. I don't have constant but when I filter by key I am losing all cal table rows
0 -
What are you trying to accomplish when you filter?
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2 -
all dates between start and end date for each key. kind of subset
0 -
I apologize, I'm having a hard time fully grasping what you are trying to do, but I would suggest a filter tile with a formula rule that looks something like this:
`salesstartdate` >= `calstartdate` and `salesenddate` <= `calstartdate`
This would filter to where the date from the calendar table is between the sales start and end dates. You may need to try some different variations of this if I am not understanding what your final result set should contain.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.3 -
@MarkSnodgrass I am still stuck with this issue. I will try to explain again. I have a dataset with random dates column, ID column and Sales. I am trying to add all missing dates in the dataset. There are multiple sales on a single day , in that case I have grouped them to get one row for one date. Also, I have grouped the date for max and min as 'Start' and 'End' Date.
This is what I have:
And this is what I am trying to acheive:
0 -
This is what my dataflow looks like with adding calendar and filter for start and end dates
Here each cal date is joining with all dates in the dataset. Lots of extra rows are added to output.
Join between cal and data is left and cal is left table.
1 -
Stuck with the same issue, Any solution?
If Domo supports conditional joins that would have fixed the issue.
0 -
@user062848 I solved my problem in ETL is that I used Domo calendar dataset and joined with dt col. It has to be left join so that you get all cal dates in the output. Now you have sales col and cal date col. You will use cal date col moving forward since it has all missing dates in it. Do the group by for sales and move on with all modifications. Hope it helps!
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
- 754 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