Keywords - Displaying The Leaf Node + The Node Avove It

Started by Darius1968, June 25, 2021, 05:43:20 PM

Previous topic - Next topic

Darius1968

Using this expression, "{File.Categories|filter:@Keywords;level:leaf}", it's possible to see a file's keywords, but just the leaf node of the hierarchy.  Something like, "{File.Categories|filter:@Keywords;level:-2} shows the node, just above the leaf.  Is it, however, possible to allow for the display the bottom-most-two leaves, instead of having to choose one or the other? 

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968

What would be the syntax?  I can't get the desired result. 

Mario

Make one variable which extracts the leaf.
Make one variable which extracts the level you need (index function).
Use both variables.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968

#4
I'm sorry, I think, I'm not understanding just how to combine these two variables.  What am I doing wrong here:  "{File.Categories|filter:@Keywords;level:-2}{File.Categories|filter:@Keywords;level:leaf}"?

I can't see, how to combine the two, to somehow, allow them to be part of the same expression.  What's happening is that the 1st variable traverses through my entire keyword set, enumerating only the level I specified.  Then, the 2nd variable does likewise, enumerating each keyword's hierarchical level that I specified.  But how do I combine them? 

Mario

Not everything is possible. You can make the variable return individual components of the keywords in the file, but you cannot make variables returning multiple individual components of individual keywords. These are just lists of strings. If you really need this, you need to find another way.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook