Hi all, I have installed the Tags Report sheet and find it really useful, but what I would like to do is to see a breakdown of tags filtered to a category or list of categories:
There is this report, but I guess it kind of works in reverse of what you’re asking for, @jaeson.paul.
I can envision a set of operations that would get you this data.
In a new sheet, specify a category and a date range (just to manage the scope of what is queried… for performance).
Use a QUERY or FILTER function to get all transactions within that date range with the selected category.
Use the SPLIT function on all contents of the Tags column to individualize the tags. (I haven’t tried this but you’d need to create a single concatenated string from the range… and there may be an issue with the string size overflowing).
Run a UNIQUE function against that data to reduce the tags to a list of distinct (non repeating) tags.
Run a SUMIF function to query for each unique tag.
That’s how I’d work up to it.
Hope this flow helps.
Ahh, good point, @randy. I hadn’t considered multiple tags in a transaction…
After thinking it over more, I have a basic functioning formula that will create a table of summed Amounts for one Tag per row and Category per column. This works with the Foundation sheet with a Tags column added between Categorized Date and Date Added. I still need to replace the direct column references with INDIRECT lookups. A WHERE clause for Category MATCHES and Tag MATCHES can easily be added, but I still need to come up with an efficient way to do a multi-select of categories and tags aside from a long list of data validation drop-downs. There are some columns I can also trim from the inner query. This is a start at least.
=QUERY(INDEX(QUERY(SPLIT(FLATTEN(Transactions!B2:B&"|"&Transactions!C2:C&"|"&Transactions!E2:E&"|"&Transactions!F2:F&"|"&SPLIT(Transactions!Q2:Q,",",)),"|"),"WHERE Col5 IS NOT NULL")),"SELECT Col5,SUM(Col4) GROUP BY Col5 PIVOT Col3 LABEL Col5 'Tag'")
This formula effectively splits single transactions with multiple tags into multiple transactions with a single tag and then queries that virtualized transaction table with a pivot to get the desired result. Theoretically it will work with any number of tags and categories.