Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Generate rows with condition

marymgimenez
6 - Meteoroid

Hello,

 

I’m trying to create a table dynamically to list unique combinations of two columns. In the sample below, there are two identifier columns, X & Y. I need the unique combinations of X & Y regardless if the value is interchanged in both columns. In the table below, Row 1 and 3 are similar because both have ‘AA’ and ‘BB’ values. I only want to keep one record from these two.

Source Table:

Row #

X

Y

Combination (X + Y)

Reverse (Y + X)

1

AA

BB

AABB

BBAA

2

AA

CC

AACC

CCAA

3

BB

AA

BBAA

AABB

4

BB

DD

BBDD

DDBB

 

The output table will list only the following. Row 3 was removed since the values are similar to Row 1.

Row #

X

Y

Combination (X + Y)

Reverse (Y + X)

1

AA

BB

AABB

BBAA

2

AA

CC

AACC

CCAA

4

BB

DD

BBDD

DDBB

 

Which tool is best to accomplish this in Alteryx? I tried to use Generate Rows but couldn't make it work. Thank you!

4 REPLIES 4
DavidP
17 - Castor
17 - Castor

My preferred method would be to transpose the Combination and Reverse, then use a Unique tool to remove the dups and CrossTab back

 

DavidP_0-1592430801901.png

 

RobertOdera
13 - Pulsar

Hi, @marymgimenez 

 

Try this.

Please mark as a solution + like, if it works for you.

 

Dynamic set up plus uses ReverseString() formula.

Stepped though it to show you how that works.

 

RobertOdera_0-1592431742000.png

 

The workflow is attached.

Cheers!

marymgimenez
6 - Meteoroid

Thank you so much for the quick response! This helps a lot. Appreciate your help!

RobertOdera
13 - Pulsar

@marymgimenez 

You're most welcome!

Cheers.

Labels
Top Solution Authors