Eric (and DBB this will probably answer your final question too), I think your problem with the expression lies in our different definitions of what we put in the "opus" and "number" fields.
I use [Classical: Opus] to display whichever collection shorthand is standard for that particular composer. Eg, I use BWV _ here for Bach, but Op. _ for Chopin. I pick whichever one seems more widely referred to with respect to a particular composer.
I use [Classical: Number] in the situation of a single opus/collection/catalog (which we've specified in the Opus field above!) when there are
multiple recognised parts to it ... this is what's causing your problem, I think - you're putting the catalog number in here instead (J_, K_ etc) - the expression designed with the above usage in mind
For example if we have opus no. 38 with 4 recognised separate parts:
Op. 38 No. 1 [Classical: Opus] = 38 , [Classical: Number] = 1
Op. 38 No. 2 [Classical: Opus] = 38 , [Classical: Number] = 2
Op. 38 No. 3 [Classical: Opus] = 38 , [Classical: Number] = 3
Op. 38 No. 4 [Classical: Opus] = 38 , [Classical: Number] = 4
Another Opus might not have parts and might appear as such:
Op. 21 [Classical: Opus] = 21 , [Classical: Number] = Empty
With these definitions, you will never have a "Number" without an "Opus", as the number refers to multiple parts of the first.
So I guess the specific hierarchy would go: [Work] > [Opus] (which might be Op._ or J_ or K_ or BWV) > [Number] > [Movement]
With respect to your first example - you're trying to show an Opus No. and Catalog No. at the same time. I never designed the expression for that (sorry!). My advice though? Pick your reference system for each composer and stick with it. Some composers have Opus No's and two separate catalog systems - splitting them into multiple fields and trying to manage all of them will give you nightmares. I can rewrite the expression to be able to show both, if you have them, but it would take a long time
To write this one, I already had to have an output for each possible combination of fields a user might have filled out. There are 6 fields - It took ages!
With respect to your second example, if you store K551 in the Opus field and leave Number Empty, you should get what you want.
I am curious why you would employ this system with so many variables if you have a small classical collection. Of course I feel the same about darichman's system. Would you actually search by opus numbers? Also I don't understand the concept of "Classical number"
1. The larger the library, the more info you need to store to be able to find things reliably and consistently.
2. Sometimes track names on classical albums give common names only for a piece (Moonlight Sonata eg) - if you are interested in seeing all the details in a standard way, an automatic formatted expression like this is really useful.
3. I might have mentioned before, I rarely
search by opus numbers. Sometimes, in specific circumstances, (eg if I need to find a piece from a sheet music book, which will usually note the Op. # or BWV etc) it can be really useful however.
4. The main reason I store it though is to have a formatted display of the piece which (1) is consistent throughout the library and (2) allows you to easily refer to a piece (good for track info displays, playing now bar etc)