Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Column wise comparison

qais1975
8 - Asteroid

Dear All, I have one table that I need to compare each column with the rest of columns. For instance, column 1 compare with column 2,3 and 4 if there are only 4 columns. The values on these columns are string. If column 1 value identical to column 3 for instance then I will create new column and add value 1.

 

any idea on how to do it in Alterx ? 

3 REPLIES 3
binuacs
21 - Polaris

@qais1975 something like this?

binuacs_0-1677087618995.png

 

qais1975
8 - Asteroid

@binuacs 

Thank you for your input, could you please explain to me more about the formula? What if I need to extend the comparison so that column 2 will also compare with column 3 in your example? Really appreciate your feedback 

binuacs
21 - Polaris

@qais1975 first you need to transpose the data with the key column RecordID (added a RecordID tool so that later this field can be used for join) and Column1 (since you want to compare column1 against the rest of the columns). In the output, you can see column1 data and the rest of the columns in the value field

 

binuacs_0-1677091774327.png

 

Just add a formula tool then compare column1 against the rest of the column and update your result

 

binuacs_1-1677091864567.png

 

 

once you have the new column cross-tab the ID column and the new field value, then join with the original input values

 

 

binuacs_2-1677091923388.png

 

 

If you want to compare column 2 against column3 you need to adjust in the transpose tool similar to column1

 

 

 

 

Labels
Top Solution Authors