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

Alteryx designer Discussions

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

Compare data in the same column

Meteor

Hi Everyone -

 

I want to compare the value between rows in a particular column and assign them new names based on the value (i.e. same name if the value are the same). For example if you look at my input data, the item column has different names for the same value, and for the output data I want it to take a look at the value column and if two rows have same value, assign them an item name that's the same. I want to keep the people attribute unchanged tho. Thank you in advance for any help / advice :)

 

Input:

ItemPeopleValue
ContributionsAnna12345
ContributionsJess10000
SubtractionsJess12345
ContributionsJim10000
OtherJim12345
ContributionsTom12345
OtherTom10000

 

Output:

 

ItemPeopleValue
ContributionsAnna12345
Contributions2Jess10000
ContributionsJess12345
Contributions2Jim10000
ContributionsJim12345
ContributionsTom12345
Contributions2Tom10000

This was indeed an interesting problem. I think I've cracked it.

 

Test1.PNG

In the bottom part, I took all the unique combinations of "Value" field and created another field "Output" for each unique value

 

Then, I mapped the output field back to the original table using join tool.

 

I've attached the workflow herein for your reference.

 

If you like my solution, then mark as approved solution and give a star to appreciate my time and efforts

Meteor

Hi there - Thank you so much for the response! I noticed in the multi-row formula you used "IF [Row-1:Value]= [Value] THEN "Contributions" ELSE "Contributions2" ENDIF". This wouldn't work if I have more than 2 types of value(and I do). Is there a way to make it "Contributions", "Contributions1", "Contributions2", etc. (i.e. add a number for each new item name)? Thank you!

Alteryx Certified Partner

@zoeuno 

 

Here's a possible solution for you. Not sure if the Item is always be updated to "Contributions" or if there's additional logic to determine what name should be used. In this case, I just chose the "First" (Summarize tool). 

image.png

 

Hope this helps!

Jimmy
Teknion Data Solutions

Labels