Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Get unique rows based on two columns where the values in each column does not repeat

timothyyeo
7 - Meteor

Hi All,

 

I'm stuck on a problem in alteryx designer that I hope someone in this community can help with?

 

I'm trying to get unique rows from the dataset below based on unique values in columns  TransactionCode ,B, and C where values in B and C do not repeat.

TransactionCodeBExpenseAmountCRight_ExpenseAmount
201992100010006237001-400004400
201992100010006237001-400005400
201992100010006237001-400006400
201992100010006237002-400004400
201992100010006237002-400005400
201992100010006237002-400006400
201992100010006237003-400004400
201992100010006237003-400005400
201992100010006237003-400006400
20199210001000653600130002-30
20199210001000653600130006-30
201992100010006536004-3000330
201992100010006536004-3000730
20199210001000653600530002-30
20199210001000653600530006-30
201992100010006536008-3000330
201992100010006536008-3000730
20199210001000733300190002-90
201992100010007333004-9000390
20199210001000733300554006-54
201992100010007333008-5400754
201992100010008598001530.22002-530.22
201992100010008598004-530.22003530.22
2019921000100085980051974.96006-1974.96
201992100010008598008-1974.960071974.96

 

For eg. for rows with TransactionCode "201992100010006237", the correct result is shown below. If you see, I'm not looking for unique combinations of TransactionCode, B, C. Instead, it has to be ensured that individually taken, the values in B and C should not repeat. In the example below, once 001 in B has been returned, it should not be returned in another row in the result. Similarly, once 004 in C has been returned, it should not be returned in another row.

 

Appreciate if you can let me know how this can be done in designer. Thanks for your time and help in advance.

 

TransactionCodeBExpenseAmountCRight_ExpenseAmount
201992100010006237001-400004400
201992100010006237002-400005400
201992100010006237003-400006400

 

5 REPLIES 5
Qiu
20 - Arcturus
20 - Arcturus

@timothyyeo 

I think this should work but did not know what to do if the B and C are not have same number of unique counts.

0501-timothyyeo.PNG

AkimasaKajitani
17 - Castor
17 - Castor

This workflow will work well.

But Assumptions is that the unique record count are the same between Field B and C.

AkimasaKajitani_0-1619859156537.png

 

If it is not the same, you have to go to Iterative Macro root.

timothyyeo
7 - Meteor

Hi @Qiu ,

 

Thanks for the fast reply. Really appreciate it. I don have transactions where B and C do not have the same number of unique counts, and the expenseamounts also do not match up so neatly, but I feel that will be too complicated done in alteryx so I didn't bother to post it.  

timothyyeo
7 - Meteor

Hi @AkimasaKajitani ,

 

Thanks for the fast reply. Both yours and @Qiu 's solutions work. I do have transactions where B and C do not have the same number of unique counts, and the expenseamounts also do not match up so neatly, but I feel that will be too complicated done in alteryx so I didn't bother to post it.  

Qiu
20 - Arcturus
20 - Arcturus

@timothyyeo 
Glad to help and thank you for the accept mark,

Labels