Hello, please help me display status for individual file after grouping through tags
My dataview queries:
TABLE WITHOUT ID Tags AS "Categories", rows.file.link AS "Files", Status as "Status"
FROM #Chemistry/General-chemistry_GC AND "Cards"
FLATTEN file.etags AS Tags
WHERE contains(Tags, "#Chemistry/General-chemistry_GC/")
GROUP BY string(map(file.etags, (t) => split(t, "/")[length(split(t, "/")) - 1])) AS Tags
Have you tried using “rows.Status” instead of just “Status”? Using “Status” without “rows.” will assume a group’s status instead of the individual file’s status.
Hello, this works perfectly, thank you so much for answering.
But can i ask you 1 more things. Since i change to another code that are much easier to understand. This dataview queries is working well but only 1 problem. How can i display tag as subtag only, like “#Academics/Chemistry/General-Chemistry_GC/chaos” into “Chaos” only
My dataview queries:
TABLE WITHOUT ID Tags AS "Categories", rows.file.link AS "Files", rows.Status AS "Status"
FROM #Academics/Chemistry/General-chemistry_GC
FLATTEN file.etags AS Tags
WHERE contains(Tags, "#Academics/Chemistry/General-chemistry_GC/")
GROUP BY Tags
SORT Tags DESC
Please help me, i have searched reddit and obsidian forum but neither have gave me an answer since it really complex.
Hello, thank you for answering. After i add, dataview show this error:
Queries:
TABLE WITHOUT ID map(Tags, (t) => regexreplace(t, ".*/(.+)", "$1")) AS Categories, rows.file.link AS "Files", rows.Status AS "Status"
FROM #Academics/Chemistry/General-chemistry_GC
FLATTEN file.etags AS Tags
WHERE contains(Tags, "#Academics/Chemistry/General-chemistry_GC/")
GROUP BY Tags
SORT Tags DESC
That’s because you’re using the “Tags” property with a single string instead of a list of multiple tag strings. In this case you write it as follows:
TABLE WITHOUT ID regexreplace(tags, ".*/(.+)", "$1") AS Categories
However, the “Tags” property is in plural form, so it’s not ideal to use it with a single string, it’s designed to be used with a list of multiple strings/tags.