Compare the content of tags to look for matches

OK, my final question for today :slight_smile:

I've seen methods to remove duplicate tags, but I would like an action that does the following:

Compare ARTIST and ALBUMARTIST fields. If their content is the same then delete the ALBUMARTIST tag, but if their content differs then leave both tags in place.

Thanks.

ALBUMARTIST <== $if($eql(%ARTIST%,%ALBUMARTIST%),,%ALBUMARTIST%)

... or ...

ALBUMARTIST <== $if($eql($lower(%ARTIST%),$lower(%ALBUMARTIST%)),,%ALBUMARTIST%)

DD.20150118.2130.CET

this is the basic expression:
$if($eql(%artist%,%albumartist%),1,0)

BUT: if you delete the ALBUMARTIST you will get problems on most players in respect to grouping albums together.

Also, I would use a filter as this means that only the hits are treated and not every file get evaluated.
And then it is even simpler to remove fields.

So, to get rid of a field:
Format value for ALBUMARTIST
Format value: $if($eql(%artist%,%albumartist%),'',%albumartist%)

Thank you both very much for all your help.