Can I get the MIN date over a partition with a formula tile?
I need to walk a date column partitioned by the value of another column (UID) to find the earliest date for that group.
I do not want to collapse the rows.
I've tried a number of approaches to this with a SQL perspective, but I'm starting to think Magic ETL wants me to use a Group by
.
Here are a couple of examples of my experimentation to illustrate what I'm trying to do.
min( active_date ) over( partition by acct_id )
first_non_null_value( min( active_date ) over( partition by acct_id order by active_date ASC ) )
I could group then join to get the value, I was just trying to optimize the flow.
Best Answer
-
You're correct, Minimum isn't an option, apologies. I did log a new idea to the idea exchange to add this in as it seems to be a glaring omission from that tile:
Really there isn't a way in Magic ETL except for doing a Group By and then joining back to your original dataset based on the grouping keys you used to get the minimum date.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Answers
-
Have you looked into using a Rank & Window til in your Magic ETL to get the minimum date across your column partition?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Unless I've missed something in the Magic ETL R&W implementation, that's just going to populate my new column with a rank number. I want the "first date" value to be populated as the new column's value so I can use that for a later grouping/agg.
0 -
You're correct, Minimum isn't an option, apologies. I did log a new idea to the idea exchange to add this in as it seems to be a glaring omission from that tile:
Really there isn't a way in Magic ETL except for doing a Group By and then joining back to your original dataset based on the grouping keys you used to get the minimum date.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thanks @GrantSmith. That's the work around I'm using. It works, but I wish I could do it all with a single function tile and string together a bunch of SQL statements.
I've been trying to get the hang of Magic ETL, but I may have to switch back to a basic SQL flow for this particular data set.
0
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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 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