Hello dear community! I am quite new as a Coda user and I would need some help displaying the correct information in a table. Here’s the context:
I have a first table (tab1) that shows a list of questions (questions), a rating out of 10 stars for 5 participants (one participant per column), and a total number of votes (total) in another column.
I would like to display in a second table (tab2), below the main table, the “questions” that received the fewest votes (top 3 fewest votes) and the total number of votes received by each “question” (for each row), again in a top 3 format.
Could someone explain how to write such a formula?
Hi Jonathan,
Welcome to Coda and the community.
Here is a generic example of how to get the "last N numbers in a table. I hope that gets you going in the right direction:
Regards
Piet
Hello Piet_Strydom,
Thank you for your help. I must admit that, as a beginner with Coda, I am having a lot of difficulty understanding your example. Is there a way to be more specific in relation to my needs?
I really appreciate your time. Thank you so much.
Here’s an image of what I’m trying to do. Show the 3 questions with less vote in the bottom table.
Hello Jonathan,
If you share a (dummy) doc resembling your private doc, it is a lot easier to help you.
Greetings, Joost
Hello @Jonathan_O
Here is a way to achieve what you are trying to do.
In this example, I only copied your total column, not the voting columns. What I did was set up a new column called Rank, which ranks the rows based on the voting count. To do this, I first sorted the table by the number of votes using the formula: Votes.Sort(true, TotalVotes)
. Once the table was sorted, I found the position of the current row in the sorted table using the find(thisRow)
formula. So, the complete formula is:
Votes.Sort(true, TotalVotes).find(thisRow)
.
The second table is a view of the “Votes” table, where I set up a filter that only shows rows where the rank number is less than four. This hides all other rows. Additionally, I applied a sort to the view table based on TotalVotes and hid the rank column.
Playable doc: Less voted filter · Demos
Please, let me know if it do what do you want.
As @joost_mineur mentioned, a dummy doc is always good.
Best regards,
Arnhold