# Get max value of %discnumber%

**URL:** <https://community.mp3tag.de/t/get-max-value-of-discnumber/48571>\
**Category:** Support\
**Created:** [April 15, 2020, 8:35am UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571 "2020-04-15T08:35:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam154](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@Adam154](https://community.mp3tag.de/u/Adam154)\
**Post date:** [April 15, 2020, 8:35am UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571/1 "2020-04-15T08:35:49Z")

</div>

I only want to include the %discnumber% in the filename where maximum value of %discnumber% for an album is \> 1.

I could possibly do this is the %discnumber% value is 1/2 etc, but more often %discnumber% is just the number of the disc, or omitted (which is easy to work with).

Tagging with iTunes means the discnumber is always present, even for single disc albums.

---

<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:** [April 15, 2020, 8:38am UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571/2 "2020-04-15T08:38:55Z")

</div>

the only function that sets the number of discs is the numbering assistant. See the Tools menu.  
I would not use iTunes for tagging as it is never really clear whether the data ends up in the files' tags or only in iTunes' database.

---

<div class="post-metadata">

**Author:** ![Adam154](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@Adam154](https://community.mp3tag.de/u/Adam154)\
**Post date:** [April 15, 2020, 8:41am UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571/3 "2020-04-15T08:41:08Z")

</div>

I dont want to set the number of discs though. I want to get the maximum value of %discnumber% of an album (if it exists).

---

<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:** [April 15, 2020, 8:45am UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571/4 "2020-04-15T08:45:26Z")

</div>

There is no other way than to set the "number of discs" in every file.  
MP3tag does not look at the previous or the next file to compare values - with the exception of the numbering assistant.

---

<div class="post-metadata">

**Author:** ![Adam154](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@Adam154](https://community.mp3tag.de/u/Adam154)\
**Post date:** [April 15, 2020, 8:49am UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571/5 "2020-04-15T08:49:20Z")

</div>

Thanks.

I guess another solution is to edit the tagsources file and add a function to omit the discnumber if the maximum value of it is 1. This should be possible right?

---

<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:** [April 15, 2020, 8:51am UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571/6 "2020-04-15T08:51:46Z")

</div>

a simple filter like  
%discnumber% HAS `/1`  
should show you all the files with `1/1` or even `2/1`  
so that you could delete the field with the help of the extended tags dialogue (Alt-T).

---

<div class="post-metadata">

**Author:** ![Adam154](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@Adam154](https://community.mp3tag.de/u/Adam154)\
**Post date:** [April 15, 2020, 8:53am UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571/7 "2020-04-15T08:53:45Z")

</div>

Sure, but I want avoid button presses as I have a lot of stuff to tag/rename. itunes seems to be the only tag source that sets a discnumber of 1 for single disc albums so I think I can edit that and add some logic to remove that tag before setting it.

---

<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:** [February 9, 2026, 12:28pm UTC](https://community.mp3tag.de/t/get-max-value-of-discnumber/48571/8 "2026-02-09T12:28:31Z")

</div>


