How to do generate_series in a SQL dataflow
Hi,
I'm trying to elimate the need for a database between our production system and Domo by doing all ETL work within Domo (I know this may take longer to process). The database is PostgreSQL and some of the queries that I need to do in Domo use a function called generate_series, but it appears there is not a simple MySQL equivalent to this. I'm trying to do a SQL dataflow for the ETL, but need help figuring out how to code that function to work in Domo. Here's one of the simpler examples where this function is being used:
SELECT id, owner, date_trunc('MONTH',day)::DATE AS date, SUM(amount/days)AS splitamount
FROM(SELECT*,end_date-start_date+1 AS days,generate_series(start_date, end_date, INTERVAL '1 day')::DATE AS DAY
FROM opportunity) k
WHERE NOT EXISTS(SELECT oppty_id
FROM orders t
WHERE t.oppty_id=k.id)
GROUP BY 1,2,3;
Can anyone help advise how to make the same thing happen in MySQL?
Best Answer
-
Domo has a connector called Domo Dimensions that is a data table of all calendar dates that is useful for this type of work. If you search for calendar in the connectors section of the App Store, it should show up. If it doesn't ask your CSM to enable it. This can save you some work when needing to build a table full of dates.
**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.1
Answers
-
-
Domo has a connector called Domo Dimensions that is a data table of all calendar dates that is useful for this type of work. If you search for calendar in the connectors section of the App Store, it should show up. If it doesn't ask your CSM to enable it. This can save you some work when needing to build a table full of dates.
**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.1 -
The trouble with the first possibility is that I need to have a specific end date as well as a start date. This serires is used towards calculating when and how long a campaign ran to understand the revenue generated from it.
I'll look into the Domo Dimensions as that sounds like it might be a good option and help with the other SQL statements I need to work out for this too.
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
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 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