Have multiple tables populate a column in a single table by group?

Lets say I have 3 tables. 2 are apple and banana, and another is fruit, which has apple and banana groups. There is an additional column in the apple and banana tables, score. I am bringing the score from the banana table into a score column in the fruit table with a filter, but would also like to be able to bring in the score from apple table into the score column in the fruit table.
Is this possible ? If not, what would be a good alternative?

Hi Vince

Welcome to Coda!

Could you provide an example of what you are trying to do? I am not getting the picture?

Thanks
Piet

Hope this example helps :

^basically, i want the score for the entry in the banana group in the fruits table to read “9”, ie to be populated with the matching score for that id in the banana table . Right now, its pulling from the apple table but not the banana, and im not sure if theres a way to do this. im currently only using a formula like apple.filter(id=thisRow.id) for score column in the fruit table.

thanks,

Vince

Hi @vince_paris,

Perhaps a slightly different data modelling would help to obtain what you want.

Instead of three different tables hierarchically connected (Fruits -> Apples, Bananas), how about a single one with attributes that allow you to discriminate what kind of Fruit is your row?

Please, have a look at this example:

And let me know if fits your actual use case.

Cheers!

2 Likes

And activate the “summary” function on the score column if you want subtotals.

2 Likes

Hi @Federico.Stefanato! this is great; only thing is, in my real doc, the apple and banana tables need to be in their respective apple and banana pages, under the grouped fruits page. the structure of the doc is like :

fruits page ( has grouped fruits tables )

  • apple page ( has apple table )

  • banana page ( has banana table )

Unless there is a way to hide rows on the different pages? If there is a way to hide rows, i have not figured out how to do so. . .

HI Vince,

You can definitely expand @Federico.Stefanato 's suggestion to do that.
On the apple page for example, type /table, select your fruits table from the list. It will pull in a View of the fruits table. Rename it as required, and filter on the species field for “Apple”.

1 Like

Hi @vince_paris,
I tried to give an example of what @Piet_Strydom suggested: have a look at the subpages of the example I shared before.

Anyway, you can always “hide” - or filter - rows through Filter().
Looking at Formula reference and the Coda Gallery will help to familiarise with the capabilities of Coda.

Anyway, feel free to ask if something is not clear.

Cheers!