View Single Post
Old 12-21-2020, 01:38 AM   #1
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,037
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Removing hierarchy levels

I created a list_union composite to separate the hierarchical tags and make it look neater in the details view.

I actually got it working as I expected (e.g. Fiction.Animals.Cats, Fiction.Mystery.Cozy Mystery becomes Fiction, Animals, Cats, Mystery, Cozy Mystery).

However, how would I strip out any sublevel items under specific tags?

e.g. Fanfiction.Crossover and Documentation and Manuals.Video Games.Strategy Guides, I just want the top levels to appear. (I have them grouped in general broad tags and use custom manual/fanfic-specific columns for actual filtering.)

I thought list_difference would work but I'm not really sure what I'm doing:

Code:
{tags:'list_difference(re($, '\.', ', '), 'Fanfiction', ',')'}
just removed fanfiction

Code:
{tags:'list_difference(re($, '\.', ', '), 'Fanfiction.Crossover, ',')'}
didn't work (and isn't ideal anyways as I'd have to manually enter them all)

Code:
{tags:'list_difference(re($, '\.', ', '), 'Crossover, ',')'}
did work, but also isn't ideal (and it'd also destroy any matching tags, e.g. Documentation and Manuals.Video Games - Comics.Video Games)


Last edited by ownedbycats; 12-21-2020 at 05:21 AM.
ownedbycats is offline   Reply With Quote