Grouping by Column of a Looked-up Row

I have a table, T1, that has a column C1 that is formatted to be a lookup from another table, T2. I set the “display column” in T2 to be the column that I want to “choose from” when choosing the value for C1. T2 has a column C2 that I’m interested in as well.

It would be nice if I could put in a grouping on T1 by C2, per the value I’ve selected in C1. E.g. the grouping I’d potentially set would be C1.C2.

Currently I can only select C1, i.e. the primary columns on T1.

The workaround is to create a column, C3, on my table (T1) and set a formula on it to be C1.C2 and then group by C3. This “bloats” T1 with additional columns that I don’t need to replicate.

Is what I’m trying to do reasonable? Does the suggestion make sense? Does anyone else have this same itch?

Thanks!

1 Like

I think I’m following what you want to do, but correct me if I’m reading this wrong. And a solution is possible in Coda to pull from other columns in another table that is a lookup table.

Table 1
C1 (lookup from T2C1) | C2 (to show T2C2 value) | C3

Table 2
C1 (display) | C2 | C3

For Table 1 C2 to be what Table 2 C2 equals, you would use a formula…

Table 1 C2 Formula
[T1C1 Column Name].[T2C2 Column Name]

1 Like

Thanks @benblee.

The request I’m making is actually in the Grouping functionality - i.e. where you define sort/grouping on a Table. The dropdown list for what you want to Group on is limited to the columns of the immediate Table, and not by attributes of a column in the immediate Table.

E.g.

Table 1
Column A (looks up from Table 2)
Column B

Table 2
Column X (display)
Column Y

I’m only able to group Table 1 by Column A and Column B, but not by ColumnA.ColumnY.

Maybe I’m pushing what should be reasonable for expected behaviour but thought it would be nice if I could do something like that when a “lookup from table” format was in play.

Does that make more sense now?

Thanks again!

Oh, I see.

I think you’ll need the extra column to group by anyway even if it’s just to get the title of the group to show. Grouping by a secondary, even if it works, won’t allow for a label.

This will also make editing easier.

Thanks for that @benblee.

Editing isn’t a big deal in this situation as in Table 1.Column A I’m choosing from a list of thing from Table 2, based on the display column that is set, and that’s sufficient.

However, in some “views” that I create of Table 1, it would be good to group by, say, Column Y on Table 2. I could contrive some examples, but in short, I don’t need to edit the data in that view of Table 1, or if I did, I would only be editing Table 1 and not anything that would impact Table 2.

I suspect I’m stretching things here in an unintended way, and that’s OK, but I just noticed myself having to add a lot of extra columns to a Table for this kind of purpose and that started to feel like undesirable bloat of that table and unnecessary repetition of data that could be accessed otherwise, e.g. as I can in a formula without creating the extra column.