Duplicating Rows based on a number value

Hi Community !

I’m trying to create a table to have multiple availability from employees, my envisioned solution might be too complicated, so I’m opened to suggestions !

Here’s where I am at.
I have a table that generates dates (each row is a date), the other columns in this table are as follows;

  • Relation column to a table where we enter the employees as single rows, this column combines the employees and their availabilities for that date.
  • Related column from the previous one, with the availability status (stand-by, available and not av.)
  • a Count() column that counts how many employees have availabilities for this date.

I’m trying to create a button, that will create a table that has duplicates rows for each dates when there are more than 1 employee with availabilities on that date. e.g.
01/01/2025 - Employee 1 - Available
01/01/2025 - Employee 2 - Not Available
02/02/2025 - (and so on…)

Therefore I want to refer to the number of employees (count() column) with avail. info for this unique date to create the number of duplicates of that date to add to the new table.

I taking this route because when creating new availabilities we want to be in the employee section, and simply all the unique dates for them. Then all of these are stored in the initial table. And restructure in duplicate dates table to be viewed as a calendar where on each day we see the availability for individual employees.

Hopefully, it’s clear enough !
Thanks !

1 Like

I’m not sure I got your use-case completely, but you can keep things simple and effective by thinking throught your data model and making a smart usage of the available visualizations in Coda.

This little demo I built doesn’t use any button/automation. Let me know what’s missing on it to be helpful for your use case.

1 Like

Unfortunately, the client need it to be a calendar view, and to be able to mass process new availabilities, adding name, single date and availability each time is not an option

So in order to ease the clients work inputting data, I offer a solution where they mass add dates for the employee, and I would split them back into another table to generate the calendar.

1 Like

Created this quick over view to illustrate the table desire.

1 Like

Ok, so at least the data model is not far-off from what I posted in the demo. If you use the grouped view, availability and date are automatically filled in. It’s not a Calendar view though, so let’s move on.

I still don’t understand what kind of workflow you have in mind. It would be helpful if you would describe step by step your ideal process you imagine for the clients to add the data, and then I can tell you how I would approach it in Coda.

The Calendar view is quite restricted, but there are ways of simulating a Calendar view with Cards, which are much more flexible.

1 Like

Hi Pablo :slight_smile:

I was able to do this ! and it duplicates the dates and not include the empty ones, but I still need to split my “fournisseur” (Employee) and my “Disponibilité” (Availability) - sorry I work in french.

Right now I’m working, on splitting the names and availability based on the number of “décompte” (amount).


If you have any ideas, would love to hear them out ! :slight_smile:

Thanks

1 Like

Please share a dummy doc, it’s too hard to help you otherwise.

But what you are trying to do doesn’t seem efficient. Probably I could advise you better if you describe more precissely what you are trying to achieve without already defining a technical implementation.

1 Like

Hi,

Hopefully this works, I’ve created this playground page;

1 Like

I see now what you are trying to do now. I think your current approach is a bit convoluted and you might need to get rid at least of 1 or 2 tables, it would take me too long to look in detail and tell you exactly. Calendar Reference Table for sure is one of them.

But I agree that you might need one helper table to mass update availability from employees.

This is what I would do (assuming only 1 user will use this simultaneously. If you want several users to mass edit at the same time it’s possible but it gets more complex) :

  • Create (or reuse) a helper table, with Date and Availability type columns. Create automations so that it always have X months worth of rows in to the future and delete whatever is not relevant according to the date
  • Create a button per employee that
    • clears the Availability type column
    • fills it in pulling the info from What I need the table to look like for the current employee
    • opens a detailed view modal, where this table is visible and another button that stores the changes back to What I need the table to look like

Hope this helps,

Pablo

1 Like

Will try to work in that direction, but the thing is “What I need the table to look like” is the end result that’s being populated not the other way around.

Thanks for taking the time !

1 Like

My main point is that you can skip some of your middle steps and populate the end table directly

Hope you figure it out

Pablo

2 Likes

Here’s my final solution !

Much simpler !

Thanks for bringing back to simpler ways Pablo :slight_smile: Sometimes we get carried away by the requirements

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.