Distinct List_Agg
Hi Folks,
In Magic ETL, I'm grouping by a key and defining a new column using the formula:
List_Agg(customer_name, ' / ')
Is there a method to generate a distinct list of customer names by key? I don't want the repeat customer names in this value.
All support appreciated
Kind regards,
Best Answers
-
@NateBI It looks like it MagicETL may not support LISTAGG(DISTINCT), even though it is a valid SQL statement. As a work around, I'd suggest creating a separate branch of your ETL before the Group By that filters out duplicate values according to all your group by fields and RESOURCE_NAME. Then you can run a parallel Group By tile with the LISTAGG function (without Distinct), and join that back to your original flow.
0 -
GROUP_CONCAT
, which is identical in behavior but different in syntax toLISTAGG
, does support theDISTINCT
keyword as of relatively recently:GROUP_CONCAT(DISTINCT customer_name SEPARATOR '/')
Randall Oveson <randall.oveson@domo.com>
0
Answers
-
Hi @MichelleH this seems to throw an error for me.
0 -
@MichelleH it's a Syntax Error:
I've also tried DISTINCT LISTAGG(Resource_Name, ' / ')0 -
@MichelleH Yeah, this is in a Group By tile but with the formula column feature
0 -
@NateBI It looks like it MagicETL may not support LISTAGG(DISTINCT), even though it is a valid SQL statement. As a work around, I'd suggest creating a separate branch of your ETL before the Group By that filters out duplicate values according to all your group by fields and RESOURCE_NAME. Then you can run a parallel Group By tile with the LISTAGG function (without Distinct), and join that back to your original flow.
0 -
GROUP_CONCAT
, which is identical in behavior but different in syntax toLISTAGG
, does support theDISTINCT
keyword as of relatively recently:GROUP_CONCAT(DISTINCT customer_name SEPARATOR '/')
Randall Oveson <randall.oveson@domo.com>
0 -
@MichelleH Thank you, this workaround would have been the second go-to but @rco this worked for me. Thanks, both!
0
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Connect
- 1.3K Connectors
- 309 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 665 Datasets
- 120 SQL DataFlows
- 2.3K Magic ETL
- 827 Beast Mode
- Visualize
- 2.6K Charting
- 90 App Studio
- 46 Variables
- Automate
- 198 Apps
- 488 APIs & Domo Developer
- 97 Workflows
- 24 Code Engine
- AI and Machine Learning
- 23 AI Chat
- 4 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 119 Domo Everywhere
- 284 Scheduled Reports
- 11 Software Integrations
- Manage
- 145 Governance & Security
- 13 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 116 Community Announcements
- 5K Archive