# Filter syntax not evident

**URL:** https://community.mp3tag.de/t/filter-syntax-not-evident/66081
**Category:** Support
**Created:** [September 28, 2024, 12:45pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081 "2024-09-28T12:45:41Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![2418](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/2/898d66/32.png) [@2418](https://community.mp3tag.de/u/2418)
#### Post date: [September 28, 2024, 12:45pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/1 "2024-09-28T12:45:41Z")

</div>

Hello,  
(Windows here)  
I want to filter by 2 columns to be equal // not equal.  
I found  
deleted  
and  
deleted  
but they don't answer my question, since from here:  
(I had to delete the third link, all of them going to [mp3tag.de](http://mp3tag.de) though)  
(community item number 19751)  
I got  
"$if($eql(%artist%,%artist\_bak%),1,0)" IS 1  
but I don't understand why there are TWO digits within the outer parenthesis (1,0), and I haven't found it to get explained within the links mentioned.

So I tried this on my data, with, according to the example:  
"$if($eql(%filename%,%title%),1,0)" IS 0  
(from my understanding, "eql" stands for "equal", and "IS 0" for "NOT),  
but I get the full set, and with  
"$if($eql(%filename%,%title%),1,0)" IS 1  
I get a zero set, but both results are wrong, since:

Most of the column data are equal / identical, for a given row, but not all of them, so for "equal" I should get the full set minus some, and for "not equal" I should get just some results... not, as I get now, either all or nothing.

What would be the correct syntax, please, and/or where it is explained so that I can build it correctly on my own?

Thank you very much!

I always get the error that new users can only enter 2 links, but none is allowed; all of them were to INTERNAL [mp3tag.de](http://mp3tag.de).....

The first two links were:  
to item Filtering and Searching Files and Tags  
and to item Filter and Search

---

<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: [September 28, 2024, 12:49pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/2 "2024-09-28T12:49:23Z")

</div>

> [@2418](#):
>
> `"$if($eql(%filename%,%title%),1,0)" IS 1`

the variable for the filename is called %\_filename%  
What is the result of  
`"$if($eql(%_filename%,%title%),1,0)" IS 1`

You see more about scripting in the documentation:

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

More on fieldnames:

> **[Tag Field Mappings – Mp3tag Documentation](https://docs.mp3tag.de/mapping/)**
>
> 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.

and other placeholders:

> **[Format Strings and Placeholders – Mp3tag Documentation](https://docs.mp3tag.de/format/)**
>
> Documentation on format strings and placeholders to describe the structure of file names and imported data. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![2418](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/2/898d66/32.png) [@2418](https://community.mp3tag.de/u/2418)
#### Post date: [September 28, 2024, 12:55pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/3 "2024-09-28T12:55:34Z")

</div>

Thank you very much for your kind help, ohrenkino, will look into the three links you gave me.  
Your syntax does NOT work, unfortunately: As mine, with "IS 0" or "IS 1", it's either all or none, whilst I'm certain that (just) some (sic!) records/files have different data within the two columns.

---

<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: [September 28, 2024, 12:58pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/4 "2024-09-28T12:58:45Z")

</div>

Please show us [screenshots](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190#use-screenshots-to-exemplify-the-issue-2) with real examples from your collection, where we can see the `%_filename%` and the `%title%` and where the filter does not work as expected.

---

<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: [September 28, 2024, 1:00pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/5 "2024-09-28T13:00:00Z")

</div>

> [@2418](#):
>
> Your syntax does NOT work

It works over here ...  
You can test the scripting function in Convert\>tag-Tag on a file for which you know the outcome. It should return a "1" for files where title and filename are equal and 0 for the opposite.

Please note that the inverted commas " are mandatory.

---

<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: [September 28, 2024, 1:09pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/6 "2024-09-28T13:09:47Z")

</div>

> [@2418](#):
>
> (from my understanding, "eql" stands for "equal", and "IS 0" for "NOT),

That is not how the command " **NOT**" works in Mp3tag.  
From the documentation about [filter commands](https://docs.mp3tag.de/filter/#not-expr):

 ![image](https://community.mp3tag.de/uploads/default/original/3X/8/8/886ffa6b2633aa946a4f6488bee0362337e347b9.png)

and for the [command "IS"](https://docs.mp3tag.de/filter/#field-is-string):

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

The more detailed explanation for  
`"$if($eql(%_filename%,%title%),1,0)" IS 1`  
Compare the content of `%_filename%` and `%title%` with `$eql`. If the content is equal (= the same) then set 1 otherwise set 0.  
`$if` returns TRUE if the check of the above comparison IS 1, otherwise it returns FALSE.  
In a filter, this returns only the songs where the content of `%_filename%` is the same as the content in `%title%`

---

<div class="post-metadata">

### Author: ![2418](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/2/898d66/32.png) [@2418](https://community.mp3tag.de/u/2418)
#### Post date: [September 28, 2024, 1:16pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/7 "2024-09-28T13:16:53Z")

</div>

I have found the same syntax in another community post, but, obviously, always with just metadata columns, NOT including the file system column "Filename" (written \_filename or filename, doesn't make any difference for the wrong results).

I have the grid before my eyes, with 2658 rows, and with some rows (before my eyes since scrolled to that location) where filename data is different from title data.

"$if($eql(%\_filename%,%title%),1,0)" IS 1 ; 0 results  
"$if($eql(%\_filename%,%title%),1,0)" IS 0 ; 2658 results

I don't know about "inverted commas", the above are what are commonly called "double-quotes", and I suppose that's correct since I've got them from ^c, ^v.

As said, I have the not-equal rows before my eyes, in the mp3tag grid; I'm at a total loss about what could be wrong here.

---

<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: [September 28, 2024, 1:20pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/8 "2024-09-28T13:20:09Z")

</div>

As I said: it works over here:

 ![grafik](https://community.mp3tag.de/uploads/default/original/3X/5/9/59b3b5fa1e6a03ad2c60fbe54906774daa19af31.png)

As you can see in the status bar: 1 of 174 files matches the criteria  
and that is

 ![grafik](https://community.mp3tag.de/uploads/default/original/3X/8/b/8be5e34642a4ff2c779ae1eabcf1e460b4308182.png)

---

<div class="post-metadata">

### Author: ![2418](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/2/898d66/32.png) [@2418](https://community.mp3tag.de/u/2418)
#### Post date: [September 28, 2024, 1:23pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/9 "2024-09-28T13:23:23Z")

</div>

LyricsLover, thank you very much for your kind explanation: That makes sense indeed, for "1,0".

ohrenkino, I don't doubt it works for your data, but I'd need an explanation why it doesn't, for my data. Currently trying to make a screenshot...

---

<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: [September 28, 2024, 1:25pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/10 "2024-09-28T13:25:23Z")

</div>

See here

> [@Hints for asking Support Requests](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190):
>
> If you need support using Mp3tag, you can help the community members that are about to support you in finding a solution or workaround to your problem, by following these simple guidelines. Be descriptive, also in what you’ve already tried Please give a short explanation what’s not working as expected or what you’re trying to achieve. It’s best to know any details about the problem at hand and especially, what steps you’ve already tried to solve it by yourself. Helpful information also includ…

---

<div class="post-metadata">

### Author: ![2418](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/2/898d66/32.png) [@2418](https://community.mp3tag.de/u/2418)
#### Post date: [September 28, 2024, 1:31pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/11 "2024-09-28T13:31:12Z")

</div>

Have made the screenshot, but don't find a way to upload.

 ![mp3tag - 2024-09-28 15_27_54-Window](https://community.mp3tag.de/uploads/default/original/3X/9/d/9dcab113c4df2e3d79e03dcb9113c69f2c34ab45.jpeg)

Thank you again, LyricsLover.

Screenshot to be understood by what I said, just in some files, the data of the 2 columns varies, and the screenshot shows most of them, but together with the full set number 2,658 in total.

---

<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: [September 28, 2024, 1:34pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/13 "2024-09-28T13:34:28Z")

</div>

At least the `%_filename%` and `%title%` in the songs starting from the 5th line are no more equal, because of the leading number in brackets in the \_FILENAME and the trailing year in TITLE  
`(01) MfG`  
is not equal to  
`MfG - Mit freundlichen Grüssen (2022)`

---

<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: [September 28, 2024, 1:35pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/14 "2024-09-28T13:35:31Z")

</div>

it shows that the TITLE includes the extension whereas %\_filename% does not. You would need %\_filename\_ext% for that

---

<div class="post-metadata">

### Author: ![2418](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/2/898d66/32.png) [@2418](https://community.mp3tag.de/u/2418)
#### Post date: [September 28, 2024, 1:36pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/15 "2024-09-28T13:36:37Z")

</div>

at LyricsLover: Yes, that's why I made THIS screenshot, and not the one showing the 2,658 items. But I could do a screenshot with "IS 1", and which would show an empty list; do you want to see it?

at ohrenkino: I understand what you mean but I can't see how that would be the problem, since the equal-data shows the suffix .wav in BOTH columns, and that's intended. Please see the first 4 rows, and more than 2500 of my 2658 rows are like that: filename with suffix, and title with suffix.

---

<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: [September 28, 2024, 1:39pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/16 "2024-09-28T13:39:46Z")

</div>

> [@2418](#):
>
> the equal-data shows the suffix .wav in BOTH columns

What does the column definition for the filename show as "Value"?

Couldn't you simply use %\_filename\_ext% in the filter expression, just for a try?

---

<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: [September 28, 2024, 1:40pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/17 "2024-09-28T13:40:59Z")

</div>

> [@ohrenkino](#):
>
> it shows that the TITLE includes the extension whereas %\_filename% does not. You would need %\_filename\_ext% for that

The `TITLE` content for song #1 is  
`(219) Baby, Let Me Follow You Down.wav`

The `%_FILENAME%` content for song #1 is  
`(219) Baby, Let Me Follow You Down`  
it is missing the extension .wav

The comparison for this two values is not equal, because of the missing extension.

---

<div class="post-metadata">

### Author: ![2418](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/2/898d66/32.png) [@2418](https://community.mp3tag.de/u/2418)
#### Post date: [September 28, 2024, 1:42pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/18 "2024-09-28T13:42:30Z")

</div>

What is a "column definition"? What do you mean by "content"? But you're obviously up to something, I'll experiment! On the other hand, dots are even allowed within filenames, before the suffix-dot, so mp3tag should treat the columns "as is", i.e. as they are, NOT trying to "be smart", but perhaps, it does do that, and that creates the problem...

I think this "smartness" of mp3tag creates the problem. In fact, in order to be able to edit data manually, by ^c and ^v, I had to switch to AudioRanger, since tool that allows to select the data of ONE column/field, and to edit or copy it, etc. (NOT for file-system columns though, just for metadata columns!), whilst mp3tag selects the whole row, not just 1 column, and when then I do ^c, it doesn't copy the whole row, that's true, but it copies some weird data-combination into the clipboard; obviously, similar things occur when I try to compare a file-system column with a metadata column, here in mp3tag.

Obviously, that's a big problem, since I need these columns the way they are, i.e. I need the filename column together with the suffix, and - at the end of the day - the title column together with the suffix.

ohrenkino, I understand perfectly what you say, but my data comes from AudioRanger, and for the reasons given above, I can NOT use mp3tag for my "first step" work (i.e. for the non-availability of the "raw" data within the grid; the edit dialogs in mp3tag are extreme fuss, compared to "direct grid data" access within AudioRanger).

I then tried to use mp3tag in a second step, in order to FILTER the data set which I get AFTER my work in AudioRanger (where sometimes I must leave data "as is" since the (web-origin) metadata is better than my (CD-origin) metadata, and since my first step includes RENAMES from metadata TO filename, I use AudioRanger's File name column, instead of its File name without suffix column; otherwise the renames will make filename.wav.wav instead of filename.wav.

In other words, I'll have to "sync" all my needs in step 1 (outside mp3tag) with what I need for mp3tag (of which I need the filter function).

Will try to make it work, then report back!

---

<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: [September 28, 2024, 1:46pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/19 "2024-09-28T13:46:39Z")

</div>

Just compare the content that you SEE in your columns.

if you want to compare  
`(219) Baby, Let Me Follow You Down.wav`  
from your TITLE

then you have to compare it to  
`%_FILENAME_EXT%`  
(that includes the filename AND the extension as in your example:  
`(219) Baby, Let Me Follow You Down.wav`  
and not only  
`(219) Baby, Let Me Follow You Down`  
as in the `%_FILENAME%`

---

<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: [September 28, 2024, 1:50pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/20 "2024-09-28T13:50:49Z")

</div>

> [@2418](#):
>
> so mp3tag should treat the columns "as is", i.e. as they are, NOT trying to "be smart", but perhaps, it does do that, and that creates the problem...

MP3tag is just as smart as you have defined the column.  
So please check the column definition, see the documentation for that

> **[File List – Mp3tag Documentation](https://docs.mp3tag.de/customization/file-list/#editing-columns)**
>
> Customization options for the File List, including adding, removing, hiding, and rearranging of columns. Mp3tag is the universal Tag Editor.

To me it looks like you compare data that cannot be the same as the contents of %\_filename% (which is not the same as the colum header as that gets localized in each language and would be e.g. Dateiname in German) does not include the file extension but %\_filename\_ext% does.  
So if your TITLE also contains the file extension, you should compare the TITLE to %\_filename\_ext% and not %\_filename%

---

<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: [September 28, 2024, 2:00pm UTC](https://community.mp3tag.de/t/filter-syntax-not-evident/66081/21 "2024-09-28T14:00:27Z")

</div>

Maybe this screenshot can explain it visually:  
On a German Mp3tag you can see the column header "Dateiname" with the content of `%_FILENAME_EXT%`.  
The column with the header "Filename (as english Header-Description)" shows the content of `%_FILENAME%`  
-\> without the extension `.mp3`

In my case, I would have to compare my `%TITLE%` (without extension) with `%_FILENAME%` (without extension)

 ![image](https://community.mp3tag.de/uploads/default/original/3X/b/8/b8054bae062e50070002d575381a1538bfc14ccc.png)

In your case, you have to compare your `%TITLE%` (with extension) with `%_FILENAME_EXT%` (with extension).

 ![image](https://community.mp3tag.de/uploads/default/original/3X/1/6/163f201f391a235b1b8f59b369cd7b9488687100.jpeg)

[Next page](https://community.mp3tag.de/t/filter-syntax-not-evident/66081.md?page=2)
