Filter in magic ETL
Hi, I am trying to filter a dataset using magic ETL. The logic involves examining each id in the id column and then return the row with the highest rank. This will remove duplicate ids. I have attached images showing an example: before transformation and the desired output result (after). Can we achieve this using magic ETL? Thanks
Best Answers
-
Yes - you can use the Rank and Window tile to create a rank based on your id. Then use the filter tile to return the rank you want. If you want the min id you can just sort ascending on your rank/window function and then filter to where rank=1. If you want the max id, you can sort descending and then filter to where rank=1. In your case, if you're wanting the min rank per group. You would need to partition by ID to start the rank over again for each id.
For example. Input dataset
The above is how you could set up your rank/window tile.
Example output
Filter to where rank = 1
This output matches your example requested result.
David Cunningham
** Was this post helpful? Click Agree π, Like ποΈ, or Awesome β€οΈ below **
** Did this solve your problem? Accept it as a solution! βοΈ**2 -
I think David's reply is correct if you don't have a rank field yet. If the rank field already exists, you instead would have to group by the id to find the max(rank), and inner join that back to the data, with the join fields being id = id and rank = max(rank).
3
Answers
-
Yes - you can use the Rank and Window tile to create a rank based on your id. Then use the filter tile to return the rank you want. If you want the min id you can just sort ascending on your rank/window function and then filter to where rank=1. If you want the max id, you can sort descending and then filter to where rank=1. In your case, if you're wanting the min rank per group. You would need to partition by ID to start the rank over again for each id.
For example. Input dataset
The above is how you could set up your rank/window tile.
Example output
Filter to where rank = 1
This output matches your example requested result.
David Cunningham
** Was this post helpful? Click Agree π, Like ποΈ, or Awesome β€οΈ below **
** Did this solve your problem? Accept it as a solution! βοΈ**2 -
I think David's reply is correct if you don't have a rank field yet. If the rank field already exists, you instead would have to group by the id to find the max(rank), and inner join that back to the data, with the join fields being id = id and rank = max(rank).
3 -
Thanks @david_cunningham and @Sean_Tully . I actually have both cases one without the rank and another one with rank, so thank you both for the insightful answers. I was able to filter the data.π
1
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.8K Visualize
- 2.5K Charting
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 682 Automate
- 175 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive