Hide the selected tag group from grouped table in Dataview

Hello! I’m not even sure if doing this is possible, and it’s a bit difficult to explain it with words for me, but I’ll try to do it using also pictures.

When working in my narrative writing works, I use tags for categorizing notes in note types (such as Character, Item, Place…) and also I have a tag that is Narrative Idea (#ideanarrativa). And I have made a Map of Content of ideas I have for narrative works.

What I’m trying to do

There I just made a Dataview table, where I filtered the notes to have only the Narrative Ideas (minus Name subtag from Narrative Ideas tag). And I grouped them by tags, so they’re classified by note type. All nice to that point.

This is my query:

TABLE rows.file.link AS Idea
FROM #ideanarrativa AND -#ideanarrativa/nombre
FLATTEN tags
GROUP BY tags AS Tipo
SORT file.name ASC

But my issue is that it also creates a group for the Narrative Idea tag (which is the tag that filters the notes for the table itself), and I’d like that group to be hidden in some way, as it is not funtional for me it to appear.

This is what I get

As an extra question, is there a way to ‘change’ the name of each group? :sweat_smile:

Things I have tried

I tried some random functions that obvously didn’t bring any solution lol. I get a bit lost when needing to implement more complex coding in dataview.

I search for answers but I did not happen to find any for this kind of issue. That’s why I don’t even know if it is possible.

Thanks so much for your attention :smiling_face:

Try replacing the FLATTEN and GROUP with the following:

FLATTEN filter(tags, (t) => !startswith(t, "#ideanarrativa")) as tag
GROUP BY tag as Tipo

This should remove the #ideanarrativa tag from the tag list, and be slightly cleaner as we rename tags to tag when we flatten it.

2 Likes

Hmm… Another option could be to just add this at the end of your original query:

WHERE !startswith(Tipo, "#ideanarrativa")
2 Likes

Thank you!
I tried both options, but sadly none of them made any changes to the resulting table.

I just tried again both solutions but now deleting the #.

Using

FLATTEN filter(tags, (t) => !startswith(t, "ideanarrativa")) as tag
GROUP BY tag as Tipo

instead of

FLATTEN filter(tags, (t) => !startswith(t, "#ideanarrativa")) as tag
GROUP BY tag as Tipo

and

WHERE !startswith(Tipo, "ideanarrativa")

instead of

WHERE !startswith(Tipo, "#ideanarrativa")

And that way both worked!

Thanks so much!! :smiling_face:

Hmmm… My bad. The presence of the hash sign depends on the source you’re using, and you used tags. I’m mostly using file.etags, where is there.

Glad you found something wiring in your setting.

1 Like