# Set Compilation tag to 1 if albumartist = "Various Artists"

**URL:** https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625
**Category:** Support
**Created:** [May 9, 2024, 8:58am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625 "2024-05-09T08:58:28Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Etz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/etz/32/7648_2.png) [@Etz](https://community.mp3tag.de/u/Etz)
#### Post date: [May 9, 2024, 8:58am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/1 "2024-05-09T08:58:28Z")

</div>

Having a bit of trouble of creating corresponding action.

What I am trying to achieve, is to set COMPILATION=1 for all Albums, where ALBUMARTIST is "Various Artists" and set COMPILATION=0 for any other case.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 9, 2024, 9:05am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/2 "2024-05-09T09:05:05Z")

</div>

See the definition for COMPILATION:

> **[Tag Field Mappings – Mp3tag Documentation](https://docs.mp3tag.de/mapping/#compilation)**
>
> Overview of all available tag fields, their names in Mp3tag, and how they are mapped to the internal structures of the different tag formats. Mp3tag is the universal Tag Editor.

_Notes_ Field that is used by iTunes to mark albums as compilation. Either enter the value 1 or delete the field.  
The easiest way right now would be to

- load all the files
- filter them with %albumartist% IS "Various Artists"
- select all of the filtered files
- open the extended tags dialogue Alt-T
- create a new field COMPILATION and set value to 1.
- click ok until all dialogues are closed to save the modification.

---

<div class="post-metadata">

### Author: ![Etz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/etz/32/7648_2.png) [@Etz](https://community.mp3tag.de/u/Etz)
#### Post date: [May 9, 2024, 9:34am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/3 "2024-05-09T09:34:44Z")

</div>

I actually found solution for Action as well:

`$if($eql(%ALBUMARTIST%,'Various Artists'),1,)`

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [May 9, 2024, 10:29am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/4 "2024-05-09T10:29:06Z")

</div>

Just for the record:

The Action "Format Value" with the  
Field: COMPILATION  
and the  
Format String: `$if($eql(%ALBUMARTIST%,'Various Artists'),1,)`

![image](https://community.mp3tag.de/uploads/default/original/3X/e/1/e1c6b16c2d0f9b95d404cf4dc8c2ec7f504c1689.png)

sets the tag COMPILATION to 1 only, if the content of ALBUMARTIST is "Various Artists".  
It does NOT set the COMPILATION to `0` (Zero) if the content of ALBUMARTIST is not "Various Artists" but deletes/removes the tag COMPILATION completely.

> [@Etz](#):
>
> is to set COMPILATION=1 for all Albums, where ALBUMARTIST is "Various Artists" and set COMPILATION=0 for any other case.

If you want to set the COMPILATION in any case, you would have to add the `0` (Zero) case using this Format string:  
`$if($eql(%ALBUMARTIST%,'Various Artists'),1,0)`

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 9, 2024, 10:36am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/5 "2024-05-09T10:36:53Z")

</div>

The defintion of COMPILATION tells us that there is either the value 1 in that field or the field does not exist. So `0` would not be a valid use.

The disadvantage of the action is that it always deletes COMPILATION (if you do not set it to ´0´) , even if COMPILATON has been set to 1 for other artists. This could apply to manually set COMPILATION fields for other ALBUMARTISTS and also ALBUMARTIST fields that do not exactly match the spelling and case of "Various Artists", e.g. "Various Artist" or "various artists" would also lead to either a deleted COMPILATION field or the value ´0´.  
And as all these possible variations make it so complicated, I am very fond of filters.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [May 9, 2024, 10:43am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/6 "2024-05-09T10:43:28Z")

</div>

> [@ohrenkino](#):
>
> The defintion of COMPILATION tells us that there is either the value 1 in that field or the field does not exist. So `0` would not be a valid use.

Are you sure?

From the [id3.org](http://id3.org) [documentation](https://id3.org/iTunes%20Compilation%20Flag):

> Information  
> 1 if part of a compilation  
> 0 or not present if not part of a compilation

 ![image](https://community.mp3tag.de/uploads/default/original/3X/a/2/a2f6bef0a2d4651865eb2bf3e19d3d2b1d66042c.png)

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 9, 2024, 10:45am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/7 "2024-05-09T10:45:06Z")

</div>

see link to MP3tag documentation:

> **[Tag Field Mappings – Mp3tag Documentation](https://docs.mp3tag.de/mapping/#compilation)**
>
> Overview of all available tag fields, their names in Mp3tag, and how they are mapped to the internal structures of the different tag formats. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![Etz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/etz/32/7648_2.png) [@Etz](https://community.mp3tag.de/u/Etz)
#### Post date: [May 9, 2024, 11:07am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/8 "2024-05-09T11:07:05Z")

</div>

Yes, @ohrenkino is correct, hence I dropped original idea in favour of simplified and compliant approach.

I have “normalized” ALBUMARTIST field across my library, so misspelling or different case is not an issue.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [June 8, 2024, 11:07am UTC](https://community.mp3tag.de/t/set-compilation-tag-to-1-if-albumartist-various-artists/64625/9 "2024-06-08T11:07:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
