Sorting a table

Hello,
I have designed a page with a table displaying media investments by country:

Country Budget
Germany 256 385
Italy 134 800
France 385 000

Table is sourced by two “Airtable Collection”, one listing the countries and another one listing campaigns with their respective budget, this second collection being linked to the first one through the foreign key “Country_ID”

How can sort this table against the budget value. My purpose is not to let the end user sorting the table but instead to systematically dispaly this table in decreasing order agains the budget value.

Thank you for your help

Pascal

Hi @Pascal :wave:

You can add a sort on your collection at collection level directly or on the collection on the page if you don’t want the sort to affect the collection when it’s used elsewhere in the app.

Sort at collection level (will be applied to collection wherever it’s used in the app)

Sort at element level (for more flexibility)

Here’s a short video I recorded for you to demonstrate: Pascal - sort table — Tella

Does that help?

Hello Joyce
Thank you for your reply.
Solution 2 is the one I would like to apply, but it is not possible due to the way I built my table.
The table is linked to the collection country because i want to have a single line for each country. Then the budget value for each country is coomputed with a rollup on the collection campaign:

“rollupSum(lookupArray(item.data.Wawe,campaigns.data, ‘id’), ‘Gross Budget €’)”

As a result, this computed value is not available when I set up a sort option on the “collection list”.

Does it mean that i should build my table from the campaigns collection applying a “group by” to end up with a single line by country?

Thank you

Pascal

Can you show me what your collections look like and how things are setup in your project with some screenshots or a short video?

This will help me reproduce your use case on my side and hopefully find a solution for you.

Hello Joyce,

I replied by a mail contaning screen captures, but it seems that it did not get to you.

Nevertheless, I believe that my problem comes from the fact that I connected my table to the “Upper Collection” Country and then used the relationship with the fact table to resume the budget by country.

Hence, I am trying to do it the other way round: I connected the table do the collection Campaigns (this collection being the fact table) and I used the relationship with the collection country to get the country name. That means that I can now sort the table.

My problem is I cannot find how to define the formula when biding the table to the collection campaigns in order to get a table with only one line by country, each line summing all campaigns’ budgets for the given country.

Thank you

Pascal

Hi @Pascal :wave:

Indeed, for some reason the screenshots didn’t go through. I got the email but with no attachments :confused:

Can you add screenshots directly in this thread?

Or would you be available tomorrow at 12pm EST by any chance?

Q and Flo will be doing an office hour. I think your project could be a great use case to look into.

Here’s the link to the event if you’re interested.

Hi Joyce,

I am available tomorrow at 12pm paris time.

Regards

Pascal

Pascal Gallais-Hamonno

pgh@databikube.fr

  • 33 6 13 13 04 89

~WRD0000.jpg