Compare two fields for unique match
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Need help on comparing two fields and determining if its a match, if match is true than (in a new field) replace with true, else false.
Tried the If statements but its only replacing with the INDV ID if it matchs, else putting the FAM ID.
Please see example below.
Fam ID INDV ID
123 123 Y
124 934 N
125 564 N
Thanks for the help
Solved! Go to Solution.
- Labels:
- Expression
- Preparation

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
try this
IIF([Fam ID]=[INDV ID],'Y','N')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The "Formula" tool will create a new field; name it whatever you prefer; and make it type boolean or string; then in the "Expression" area, test equality and set the value of the variable however you prefer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks
but i keep running into the error below
invalid tyoe in operator ==
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is one side of the equality string and the other side integer, or any type mismatch of that nature? You could correct that by placing a "Select" tool before the "Formula" tool, and selecting the columns into matching data types.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks,
Sorry just noticed it was a type mismatch. its not quite matching now cause INDV ID has trailing zeros. anyone know a good way to remove them? trim doesn't seem to work on removing them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Perfect, thank you sir.
