# Filter files where \<field\> HAS \<anotherfield\>

**URL:** https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954
**Category:** Support
**Created:** [June 4, 2024, 12:26pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954 "2024-06-04T12:26:58Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![TGD](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@TGD](https://community.mp3tag.de/u/TGD)
#### Post date: [June 4, 2024, 12:26pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/1 "2024-06-04T12:26:58Z")

</div>

I want to filter songs that are from albums containing the publisher name, is that possible? Couldn't figure it out using filter expressions alone.

e.g. ALBUM = Noisekick Records 007  
PUBLISHER = Noisekick Records

e.g. ALBUM = Noisekick Terrordrang  
PUBLISHER = Noisekick Records

Preferably both examples should be matched with the filter. The latter seems like it would be too complicated to create, so if just the first example gets matched that's alright too...

---

<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: [June 4, 2024, 12:32pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/2 "2024-06-04T12:32:01Z")

</div>

You could try it with this filter:  
`ALBUM HAS Noisekick Terrordrang AND PUBLISHER HAS Noisekick Records`

---

<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: [June 4, 2024, 12:32pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/3 "2024-06-04T12:32:01Z")

</div>

Try  
`"$ifgreater($strstr(%album%,%publisher%),0,yes,no)" IS yes`

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 4, 2024, 1:44pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/4 "2024-06-04T13:44:47Z")

</div>

> [@TGD](#):
>
> e.g. ALBUM = Noisekick Terrordrang  
> PUBLISHER = Noisekick Records

Since the complete field for PUBLISHER in your second example isn't part of the ALBUM, you would have to resort to limiting the search in that case to just the first word. Or remove some text like the word "Records" since it is common in many Publishers. This is more complicated as you suggest, but can be done. However since this seems to be a pretty rare and unique search, it may be more manageable from the existing filter option such as suggested by @LyricsLover.

---

<div class="post-metadata">

### Author: ![TGD](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@TGD](https://community.mp3tag.de/u/TGD)
#### Post date: [June 4, 2024, 2:35pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/5 "2024-06-04T14:35:48Z")

</div>

Oh yeah I actually tried that one already, but it filters nothing for some reason 😕

---

<div class="post-metadata">

### Author: ![TGD](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@TGD](https://community.mp3tag.de/u/TGD)
#### Post date: [June 4, 2024, 2:45pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/6 "2024-06-04T14:45:40Z")

</div>

> You could try it with this filter:  
> `ALBUM HAS Noisekick Terrordrang AND PUBLISHER HAS Noisekick Records`

That misses the point. I need the filter to reveal **all** occurrences based on the pattern illustrated in the examples (i.e. where publisher is contained in album).

---

<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: [June 4, 2024, 3:21pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/7 "2024-06-04T15:21:30Z")

</div>

Could you show a screenshot of the filter?  
`"$ifgreater($strstr(%album%,%publisher%),0,yes,no)" IS yes`  
checks if the shorter string %publisher% can be found in the longer string %album%.  
Spelling and case has to be the same in both fields.

---

<div class="post-metadata">

### Author: ![TGD](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@TGD](https://community.mp3tag.de/u/TGD)
#### Post date: [June 4, 2024, 5:11pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/8 "2024-06-04T17:11:22Z")

</div>

Nevermind I'm just a silly goose, turns out I didn't copy the first quotation mark. 🤦‍♂️

Omitted them fully on my separate attempt before making this post, so that's why it wasn't previously working either.

Thanks

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 4, 2024, 8:13pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/9 "2024-06-04T20:13:43Z")

</div>

Right but this won't work for example #2.

> [@TGD](#):
>
> e.g. ALBUM = Noisekick Terrordrang  
> PUBLISHER = Noisekick Records

Since the string "Noisekick Records" does not appear in the Album "Noisekick Terrordrang" it will fail to come back as true.

---

<div class="post-metadata">

### Author: ![TGD](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@TGD](https://community.mp3tag.de/u/TGD)
#### Post date: [June 4, 2024, 9:19pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/10 "2024-06-04T21:19:03Z")

</div>

Yeah obviously. Just in this example alone the publisher string would have to get split by the first occurence of space and then get matched with the album field, which I think is getting too complex for Mp3tag filter. Not even mentioning most publishers' names are not in this format (e.g. Who Done It? Recordings; Raver Baby), so that would require further exceptions.

As I said though, having resolved at least the first one works too...

---

<div class="post-metadata">

### Author: ![FaceCrap](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b5ac83/32.png) [@FaceCrap](https://community.mp3tag.de/u/FaceCrap)
#### Post date: [June 5, 2024, 12:18pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/11 "2024-06-05T12:18:40Z")

</div>

> [@TGD](#):
>
> ALBUM HAS Noisekick Terrordrang AND PUBLISHER HAS Noisekick Records

I may not be understanding the question correctly, but if you want to filter both scenarios

> [@](#):
>
> e.g. ALBUM = Noisekick Records 007  
> PUBLISHER = Noisekick Records
> 
> e.g. ALBUM = Noisekick Terrordrang  
> PUBLISHER = Noisekick Records

Would then

```auto
ALBUM HAS Noisekick AND PUBLISHER HAS Noisekick

```

not match both?

---

<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: [June 5, 2024, 12:23pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/12 "2024-06-05T12:23:00Z")

</div>

> [@FaceCrap](#):
>
> Would then
> 
> ```auto
> ALBUM HAS Noisekick AND PUBLISHER HAS Noisekick
> 
> ```
> 
> not match both?

Yes. This would match if the string is fixed.  
But then you would have to type in each name that you find in PUBLISHER.  
The original problem was:

> [@TGD](#):
>
> I want to filter songs that are from albums containing the publisher name

which means that the publsher name could be anything but should be part of the string in ALBUM.

---

<div class="post-metadata">

### Author: ![FaceCrap](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b5ac83/32.png) [@FaceCrap](https://community.mp3tag.de/u/FaceCrap)
#### Post date: [June 5, 2024, 12:32pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/13 "2024-06-05T12:32:17Z")

</div>

> [@ohrenkino](#):
>
> which means that the publsher name could be anything but should be part of the string in ALBUM.

I suspected it wasn't that simple, it needed to match regardless of what is in both fields, so any word present in PUBLISHER that also matches a word in ALBUM... yeah, that's not gonna be a straight-forward filter given the second example doesn't match a part in the ALBUM name other than a single word

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 5, 2024, 12:36pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/14 "2024-06-05T12:36:17Z")

</div>

> [@ohrenkino](#):
>
> The original problem was:
> 
> > [@TGD](#):
> >
> > I want to filter songs that are from albums containing the publisher name
> 
> which means that the publsher name could be anything but should be part of the string in ALBUM.

This is a complex filter but not impossible. It will require some thought on just how much of the Publisher name is required to be found within the Album title to be considered a match. The first word or complete string may work in some cases. But there will still be exceptions for Publishers with an Article (A, An, The, Le, La, etc) as the first word.

Sometimes the concept though functional requires more time and effort than the time to manually process these types of searches. Even in a very large library these types of rare use cases are a good example of this.

---

<div class="post-metadata">

### Author: ![TGD](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@TGD](https://community.mp3tag.de/u/TGD)
#### Post date: [June 5, 2024, 12:40pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/15 "2024-06-05T12:40:40Z")

</div>

> Sometimes the concept though functional requires more time and effort than the time to manually process these types of searches.

Precisely. I ended up making an assumption that these albums are Various Artists (my guess is that 95 % of them are), which narrowed it down enough and I just went through the results manually.

---

<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: [July 5, 2024, 12:41pm UTC](https://community.mp3tag.de/t/filter-files-where-field-has-anotherfield/64954/16 "2024-07-05T12:41:33Z")

</div>

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