community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Duplicate Record - Identifying and Designating a record is Duplicate

Atom

Having a tough time putting this together.  I have these two tables.  Is there a way to do this in-db and regular flow.

 

Table 1:

Task_IDResource Name
1Johnny Bravo
1Johnny Bravo
1Joshua Washington
2Teddy Jones
3Samuel Jefferson

 

Table 2

Task_IDTask_ID Name
1Cleaning
2Housekeeping
3Something Else

 

Result:

Task_IDTask_ID NameResource Name
1CleaningMultiple/Duplicate
2HousekeepingTeddy Jones
3Something ElseSamuel Jefferson

 

 OR

 

Task_IDTask_ID NameResource Name
1CleaningJohnny Bravo, Johnny Bravo, Joshua Washington
2HousekeepingTeddy Jones
3Something ElseSamuel Jefferson
Highlighted
Alteryx Certified Partner

Hi @SYang1 

 

If you're using In-DB, I assume you'll need to do a few steps:

 

Summarize Table 1

Group BY Task ID and Concatenate Resource Name with separator ","

 

Inner Join IN-DB the result of your summarize with Table 2.

 

Cheers,

Atom

How do you concatenate resource name across rows (In-Database)?  

Alteryx Certified Partner

@SYang1 

 

Using Summarize IN-DB

 

Add Resource Name as String > Concatenate

 

cheers,

Atom

I don't see the concatenation option for Summarize in-DB 

 

Untitled.jpg

Alteryx Certified Partner

@SYang1 

 

Hmm maybe this option is not available with IN-DB Summarizing and I'm mistaken.

 

Why don't you try to write a query in your Connect In-Db with this table?

 

SELECT ID, STRING_AGG (Resource Name, ',') AS Resource Name FROM Table 1 GROUP BY ID;

 

OR

 

SELECT ID,       STUFF((SELECT ',' + Resource Namme
              FROM   Table 2 AS T1
              WHERE  T1.ID = T2.ID
              FOR XML PATH('')), 1, 1, '')
FROM   Table 2 AS T2GROUP  BY ID; 

 

Then you don't need to do this Summarize step.

 

Cheers,

Labels