We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Compare value for multiple fields (100+)

mer
6 - Meteoroid

I need help comparing value for multiple fields. I have over 100 fields that need to be reviewed. I tried creating a formula however, it will take quite some time to add a formula for each comparison (i.e IF [LAST NAME] = [LAST NAME FH] THEN "MATCH" ELSE "REVIEW" ENDIF) since I have over 100 fields. The field that needs to be compared contain a suffix of FH. I need a new validation field added for each comparison. 

Below are examples of my field names.

LAST NAME

LAST NAME FH

FIRST NAME

FIRST NAME FH

BIRTH DATE

BIRTH DATE FH

TERMINATION DATE

TERMINATION DATE FH

8 REPLIES 8
caltang
17 - Castor
17 - Castor

I would suggest to pivot it and batch it if needed. But can you give some sample data and sample output to better help with the request?

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
KGT
13 - Pulsar

Yep, pivot/transpose would be my go to here. If you have 100 million rows, then you would want a more efficient method, but transposes are going to be easiest. Transpose all your "Non-FH" fields, and in parallel pivot all your "FH" fields, Use a formula to create a field that removes the FH, and then join on your key fields and [Name]. Then compare.

 

A little used tool, but does exactly this, is the arrange tool. You can add a column and select all the "Non FH" fields, then add another column and select all the "FH" fields. Select all others as key fields, or add a RecordID and select it as Key. You will then have them next to each other, and can compare.

 

The other option is Dynamic Formula from the CReW Macros, that will enable you to programmatically create all the formulas, but is a little more setup than the above.

flying008
15 - Aurora

Hi, @mer 

 

FYI.

 

录制_2025_03_21_09_31_04_938.gif

 

 

Input           
LAST NAMELAST NAME FHFIRST NAMEFIRST NAME FHBIRTH DATEBIRTH DATE FHTERMINATION DATETERMINATION DATE FH    
11203344    
01224455    
            
            
Output           
LAST NAMELAST NAME FHLAST NAME_CompareFIRST NAMEFIRST NAME FHFIRST NAME_CompareBIRTH DATEBIRTH DATE FHBIRTH DATE_CompareTERMINATION DATETERMINATION DATE FHTERMINATION DATE_Compare
11Match20Review33Match44Match
01Review22Match44Match55Match

 

LAST NAME_CompareFIRST NAME_CompareBIRTH DATE_CompareTERMINATION DATE_Compare
MatchReviewMatchMatch
ReviewMatchMatchMatch

 

mer
6 - Meteoroid

Hello. Thanks for your help. I have around 30k rows and over 100 columns. Below is sample data.

mer
6 - Meteoroid

@flying008 Thank you! This is what I'm looking for. Are you able to share the workflow so I can review the configuration? 

flying008
15 - Aurora

Hi, @mer 

 

The Multi-Row Formula is :

IIF([RowCount] = 2, IIF([Row-2:Value] = [Row-1:Value], 'Match', 'Review'), [Value])

 

 

录制_2025_03_21_10_47_57_556.gif

 

录制_2025_03_21_10_19_21_589.gif

 

RecordIDIDLast NameLast Name FHLast Name ValidationFirst NameFirst Name FHFirst Name ValidationBirth DateBirth Date FHBirth Date ValidationTermination DateTermination Date FHTermination Date ValidationAnnual PayAnnual Pay FHAnnual Pay ValidationAnnual Pay CurrencyAnnual Pay Currency FHAnnual Pay Currency Validation
1598765SmithSmithMatchCindyCindyMatch2000-7-12000-7-1Match2024-12-12024-12-1Match3500040000ReviewUSDEURReview
2569859BrownBrownMatchJenniferJenniferMatch1999-5-81999-5-8Match2023-11-52023-11-4Review7000070000MatchUSDUSDMatch
3679682SmithSmithMatchAndrewAndrewMatch1975-5-31975-5-4Review2024-10-62024-10-6Match500000500000MatchUSDUSDMatch
459682WilliamsWilliamsMatchKarenKarenMatch1982-12-251982-12-24Review2024-9-82024-9-8Match150000150000MatchEUREURMatch

 

******

If can help you get your want, please mark it as a solution and give like for more share.

 

KGT
13 - Pulsar

I thought I would give the Arrange tool a try because I don't often find a great use case for it. The selection of fields is not dynamic in it like it is in Transpose, and the transpose gives more control over creating extra fields, like something representing the field name.

 

So, I would still go with the bottom option in this screenshot, but the arrange tool could give you a quick summary of how many matches per ID.

 

Screenshot 2025-03-24 112528.png

mer
6 - Meteoroid

Thank you all for your help!!

Labels
Top Solution Authors