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 '/')
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 '/')
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
- 1.4K Product Ideas
- 1.4K Ideas Exchange
- 1.4K Connect
- 1.1K Connectors
- 282 Workbench
- 3 Cloud Amplifier
- 4 Federated
- 2.8K Transform
- 86 SQL DataFlows
- 548 Datasets
- 2.2K Magic ETL
- 3.2K Visualize
- 2.3K Charting
- 543 Beast Mode
- App Studio
- 26 Variables
- 566 Automate
- 134 Apps
- 411 APIs & Domo Developer
- 21 Workflows
- DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 344 Distribute
- 86 Domo Everywhere
- 257 Scheduled Reports
- 1 Software Integrations
- 85 Manage
- 84 Governance & Security
- 6 Product Release Questions
- Community Forums
- 41 Getting Started
- 27 Community Member Introductions
- 81 Community Announcements
- 4.8K Archive