The expand modifier does not work with calculated fields. I have a field named Work that I use for grouping classical compositions. The following search is close to doing what I want (a random list of works)
-[Work]=[] -[Genre]=[Cantata],[Christmas],[Opera] ~sort=Random ~expand=Work
The problem is that if I have several recordings or performances of the same piece, they're listed one after the other, and I'm not always in the mood to hear a particular string quartet 8 times in a row. To overcome this I created a calculated field named WorkArtist that is empty if the Work tag is empty, but Work - Artist otherwise:
If(IsEmpty([Work]),,[Work] - [Artist])
(have to thank beautiful Zelda from Galaxy 9 for help on that one)
However, when I change ~expand=Work to ~expand=WorkArtist in my search, I get my entire library.
I searched the forum and there is evidence this would have worked at some point. See
https://yabb.jriver.com/interact/index.php/topic,128095.msg888705.html#msg888705 (although I also found another thread by HaWi who clearly states it wasn't working for him).
I'm using 27.0.43 64-bit