# Double THEN statement in IF

**URL:** <https://community.mp3tag.de/t/double-then-statement-in-if/16514>\
**Category:** Support\
**Created:** [January 17, 2015, 9:04am UTC](https://community.mp3tag.de/t/double-then-statement-in-if/16514 "2015-01-17T09:04:51Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [January 18, 2015, 1:02pm UTC](https://community.mp3tag.de/t/double-then-statement-in-if/16514/4 "2015-01-18T13:02:03Z")

</div>

> [@thaw04](#):
>
> ... When an artist already exists in my library i want to assign the genre for it i choose in the past, therefore i exported all my artists with their chosen genres ...  
> I tried something like this but probable the and function is not possible without an if?: ...

1. The functions "$and, $or, $eql, $not" etc. are boolean functions (see manual), ...  
that means, their result is only a invisible boolean value of "true" resp. "false".  
These functions are not able for connecting strings or other string manipulations.

2. I understand your problem this way, that you need a sort of lookup table, where you can search for a dedicated input value and find the related output value.

You can create such a lookup table as a simple text file, having two columns, the search column and the find column, e. g. ...  
Artist|Genre  
Jon Hopkins|Techno  
Marisa Monte|Brasileira

Using Mp3tag Actions you can load this text file into a helper tag-field.  
Then look for the search value in the helper tag-field, e. g. "Jon Hopkins", and extract the related find value "Techno".

See there ...  
[match some words from comment and put them in genre](https://community.mp3tag.de/t/15199/3)

In the past I did several attempts to do so within Mp3tag, you have to find them somewhere in the Forum.  
[https://www.google.de/search?q=site%3Aforum...+detlevd+lookup](https://www.google.de/search?q=site%3Aforums.mp3tag.de+detlevd+lookup)

> [@thaw04](#):
>
> ... So this works but what to do with new artists? I thought of adding a characteristic to the genre tag or another field so afterwards i can filter them and only review the new artists. ...

The first step would be ... set a default value for the genre, like "---unknown---" or such, ...  
then try to find the proper Artist, ...  
then get the Artist related Genre value, ... and use it, ...  
otherwise leave the genre tag-field as is or remove it.

> [@thaw04](#):
>
> ...  
> I tried something like this but probable the and function is not possible without an if?:  
> $if($and($neql(%GENRE%,'Soundtrack'),$eql(%ARTIST%,'Jon Hopkins')),'Idm Ambient',%GENRE%)$and($replace,%GENRE%,%GENRE%),$replace(%LAND%,'(new)')))

See above post #2, last proposal.  
If you want to change two different tag-fields, using the same condition, ...  
then you have to apply two actions, one for each tag-field, using the same condition.

DD.20150118.1510.CET

---

_[View the full topic](https://community.mp3tag.de/t/double-then-statement-in-if/16514)._
