Dataview plugin snippet showcase

Hi @JamesKF, I have a two solutions you can try. The first solution assume you only ever have one tag for the note.

TABLE
	regexreplace(tags, "^Type.*/", "") 
	AS "Type"
FROM #status
SORT file.name

This will give you the last word of the tag if the word Type is at the beginning. It doesn’t work well if you have multiple tags.

For multiple tags here is a possible solution. It is more verbose.

TABLE
	join(
		map(
			filter(
				split(tags, ", "), 
				(t) => startswith(t, "Type")
			),
			(tag) => regexreplace(tag, "^Type.*/", "")
		),
		" | "
	)
	AS "Status"
FROM #Type
SORT file.name

The tags are joined back together to make a string using the | character, change this to a comma if you would prefer.

5 Likes