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
- 10.6K All Categories
- 8 Connect
- 918 Connectors
- 250 Workbench
- 477 Transform
- 1.8K Magic ETL
- 69 SQL DataFlows
- 478 Datasets
- 218 Visualize
- 260 Beast Mode
- 2.1K Charting
- 12 Variables
- 19 Automate
- 356 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 249 Distribute
- 65 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 191 Product Ideas
- 1.2K Ideas Exchange
- 11 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive