Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

Reducing duplicated values among multiple columns

Highlighted
6 - Meteoroid

Hi Alteryx Community!

 

I am looking at a big data set that has a structure like this:

 

Row_PersonPersonRow_CompanyCompanyRow_SchoolSchool
1AAA1A1X
1AAA2B1X
1AAA3C1X
1AAA4D1X
1AAA5A2Z
1AAA6B2Z
1AAA7C2Z
1AAA8D2Z
2BBB1A1Y
2BBB2B1Y
2BBB3C1Y

 

This is how I am receiving the data, so I can't change the way it is being structured. 

It appears that, for each school record of a person, the company records are being presented multiple times. 

For example Person AAA went to two different schools and worked at four different companies. So for each school record, the company records are shown. 

 

This is how I need this data: 

 

Row_PersonPersonRow_CompanyCompanyRow_SchoolSchool
1AAA1A1X
1 2B2Z
1 3C  
1 4D  
2BBB1A1Y
2 2B  
2 3C  

 

I was thinking about finding a method to apply a multi-row formula to the company column, so that I can take away the "duplicates", but since every person might have different amounts of companies, it is not possible to find a common logic that would apply. 

 

Any thoughts and suggestions are very welcome!

 

Thank you!

Highlighted
Alteryx
Alteryx

I'm not sure I understand your criteria for unique values, but you can use a Unique tool to remove any sort of duplicates.

 

Simply check the fields that you could like to be a unique combination. Hope this helps!

 

echuong1_0-1595599214110.png

 

Highlighted
9 - Comet

Hi @scollier1993 

 

I've attached an example -

 

I transposed the data around the person ID,  then summarised it to remove duplicated values.

 

I then sorted the data and assigned an ascending rank to each column, that way when you cross tab it back you can create the output you desire. I then just did a little bit of cleanup on the data.

 

Ben_H_0-1595599109188.png

 

Ben_H_1-1595599256390.png

 

I'm not sure it's the most efficient way to do it, but it looks to work.

 

Regards,

 

Ben

 

EDIT* I've just noticed I changed the output order of the columns slightly! But it still does the job.

 

Highlighted
9 - Comet

Hi @scollier1993 

 

The attached should work for you. Using the transpose tool and multi-row formula tool will get most of the way there. I then split the data out to fix the duplication on the schools and combined it all back at the end. 

 

Maskell_Rascal_0-1595599862077.png

 

 
 

If this solves your issue please mark the answer as correct, if not let me know!

 

Thanks!

Phil

Highlighted
8 - Asteroid

Hi @scollier1993 ,

 

Here's my approach:

szade1_0-1595602538010.png

 

This should work for any set of dynamic values in the Rows_School and School columns for Rows_Person.

 

Hope it help!

 

Thanks,

S.

Labels