depends on what is possible @Micah_Lucero
we really care the most about the Category Order Dashboard because that has the most Subcategories and we do most of the tickets there.
but, other Categories also have Subcategories.
i added the original Category and Subcategory tables to the document you created (and shared in a prior message) to make it easier to explain. you can see the relationships there. any Subcategory can only belong to a single Category.
so, in the example you screenshotted, the 2 Subcategories can only belong to Order Dashboard.
now, to answer your question more directly, i was thinking that as the ForEach loop is flattening each row, when the current Category is Order Dashboard then also do a nested loop to flatten out the Subcategories within (if any). In other words, several rows of Order Dashboard as the Category each with its own Subcategory. That is what i was trying to clarify in the last message.
Therefore, in the example from your screenshot, both Subcategories (Documents Panel and Expenses) only need to be flattened with Order Dashboard as the Category. No confusion with the other two categories in the ticket.
we can assume that when any of the Category in a ticket are Order Dashboard all Subcategories in the ticket belong to Order Dashboard
Its a rare corner case to have two Categories each with its some Subcategories so we ignore it. We really only care about Subcategories for tickets that are in the Order Dashboard Category
what i am after is to be able to create two reports; (1) what Categories did we work on and (2) when the Category is Order Dashboard, what Subcategories did we work on.
The last time i did this, i exported the data out of Coda to flatten it out, i think it would be much cooler to keep it all inside of Coda
This is the end result i am after:
and since Order Dashboard is so big and has so many Subcategories, we like to break that down too
notice that 11% of Order Dashboard tickets don’t have a Subcategory, this is valid. Sometimes the Category field is Order Dashboard and the Subcategory field is blank
The only other Category that has multiple Subcategories is Settings and we do not do a lot of work there
our goal is in bold above, but now that i am explaining this, i am wondering if it is not simpler to flatten out all the Subcategories. at the top of this reply i said that “it depends on what is possible”.
Is it possible that when a ticket has three Categories: Order Dashboard, Labels and Settings; and two Subcategories: Documents Panel and Expenses (like in your screenshot); that Coda can use the relationship from the tables to know that Documents Panel and Expenses are connected to Order Dashboard and flatten them out properly?
now, flattening out all the Subcategories is not important. we only care about the Subcategories for Order Dashboard. i am only mentioning this second idea in case it is easier to flatten all the Subcategories than just the Subcategories for Order Dashboard
i hope this explanation was not confusing