Filter by tag then field

I am looking to have a filter that first gets all tiddlers tagged with X. Then, for each of those tiddlers, list the value in field Y.

I have come close to figuring this out, but the first problem I’m running into is that the results include duplicates; that is, if two tiddlers have the same value in field Y, I’d like to only show that value once in the result.

Anyone have any ideas on how I can get this filter working?

have you tried using the unique[] operator?

[tag[mytag]get[myfield]unique[]]

Man oh man, I messed with the unique operator for at least an hour and did not get it to work, but as soon as I try your filter, it works perfectly :laughing:

Thank you for this. One other question - In this field, I can sometimes have multiple values separated by semicolons. Any way I could parse through these in this filter you have?

happy to help :slight_smile:

not sure of your exact use case for parsing but you can split[] the results with a semicolon delimiter:
[tag[mytag]get[myfield]split[;]unique[]]

for example, if you had three tagged tiddlers with myfield values A, A;B;C, and XYZ the above should give A B C XYZ as 4 results.

Hmmm looks like this is close, but it still treats them as a single value. For example, if I have A;B;C, it is showing A B C and this is a single link!

interesting, that isn’t the case for me:

split[] should definitely be making different results.. is this wrapped in another list macro or something that might treat the whole result as one string? maybe try using enlist[] somewhere to turn the string back into a title list.