Free Trial

Alteryx Designer Desktop Discussions

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

Compare values in a single column seperated by a comma

Shivi2110
6 - Meteoroid

In a single column i have up to 7 values which are seperated by a comma. Is there any way i can identify if there is any different value in them. Below ex column 1 is a change and column 2 is not a change.

 

Example

                Column 1.    Column 2

Row 1.    A, a, b, x          A,a,a,a,a

 

 

 

 

 

12 REPLIES 12
atcodedog05
22 - Nova
22 - Nova

Hi @Shivi2110 

 

You saying single column at the beginning but later you are giving 2 columns 🤔 confused on that. Can you give us the expected output how it should look like. Does it always have 7 values separated by comma.

Shivi2110
6 - Meteoroid

Hi,
I want the data in the below format. First 2 are input columns and last two are Output to determine, if there a change value within the each input column, where the values are separated by a comma.

 

RecordInputColumn1InputColumn2OutputColumn1OutputColumn2
1a,a,a,aa,b,c,eNo ChangeChange
2h,d,I,qa,a,t,aChangeChange
3a,a,a,aa,a,a,aNo ChangeNo Change
atcodedog05
22 - Nova
22 - Nova

Hi @Shivi2110 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1628926699382.png

 

Hope this helps : )

 

Shivi2110
6 - Meteoroid

Yes that helps. Thanks 😊

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Shivi2110 

If the response helps please don't forget to mark it as solution.

Cheers and have a nice day!

danilang
19 - Altair
19 - Altair

Hi @Shivi2110 

 

Here's a different way to do it that will handle any number of columns to check or any number of values within each column

 

danilang_0-1628959196789.png

Start by transposing all the input columns using the record ID as key.  Split the transposed columns and make them lower case.  Count the number of distinct values in each Id and column.  If the answer is 1 then the values are all the same, so mark the answer on each row and add in the OutputColumn name.  Cross tab these and join back to your original data

danilang_1-1628959450470.png

Dan

 

 

atcodedog05
22 - Nova
22 - Nova

I had a similar thought at first. I skipped this method to prevent data explosion 😅

danilang
19 - Altair
19 - Altair

@atcodedog05 

 

If it's a choice between a dynamic workflow that explodes data and having a non-dynamic workflow that will need to be modified if the input changes a little, I always choose explosion. 

 

Dan

atcodedog05
22 - Nova
22 - Nova

@danilang 

 

You make a great point. Definitely something to be considered 🙂

Labels
Top Solution Authors