Jun 02, 2016 08:05 AM
Hi,
in the screenshot below, i have a start date field and a formula field that give the number of seconds of the moment (an end date field exists but is hidden).
I would like to get the duration by day (and/or year/month/week… you get the idea) but can’t find a way to do it automatically.
What i tried so far (in the day case):
In that configuration, when a new moment is created and a new start date is entered, i will have to enter manually the day of the start date in the linked field. That way, in the “Days” table the rollup field give me the sum by day i want.
But, if i also need week/month/year sums, i will have to enter theme manually for each data whereas those informations (day, week, month and year) can be extracted from the start date field via formulas.
So my issue could be summarized in: how to populate automatically a “Link to another record” field with a calculated data?
Or is there another way to achieve this?
Jun 17, 2016 01:33 PM
Have you tried datetime_format on dateadd?
Jun 19, 2016 11:30 AM
Hi, thanks for the reply!
i guess my explanation and question were unclear as i got 49 view but only 1 feedback :slightly_smiling_face:
Anyway, if i understand what you suggest, it would format my “Début” field (see below an exemple with the DATEFORMAT “YYYY-ww” displaying the year followed by the week number):
What i aim for, regardless of the ways to achieve it (in my first post i described one of my attempt and the dead end i encountered), is to calculate subtotals of the “duration in seconds” field for a day/week/month/year.
I can indeed extract the day/week/month/year of the start date of the moment (the “Début” field) with the DATEFORMAT function and even filter a view by day/week/month/year to get the subtotal of “duration in seconds” field for that filtered view (see capture below for one day). But that not practical in daily operations: i would have to do a new filtered view for each day for exemple, and that “filtered” subtotal is not exported nor referenced in formulas.
I guess that without proper solutions, i guess i will try to export my “Moments” table regularly and import that in my old Filemaker Pro 12 to get the filtered subtotals i want.
Jul 07, 2016 04:48 AM
Hi, sorry I didn’t notice your reply. Have you got a solution yet?
I confess I don’t really understand what you’re trying to achieve. It seems you want a field where a difference between dates is displayed as seconds, or days, or weeks? For that you can use datetime_diff. Or is it something else you want?
Jul 08, 2016 02:33 AM
Hi,
no worry for the late reply, it’s just a little experiment that occupy me when i have time for it, and that’s not really the case right now :slightly_smiling_face: So there is no urgency whatsoever. And thanks for the reply!
What i want to do is a project management system with time tracking/journaling at the heart of it.
I have a Moments table where i record chunks of time with start and end dates. Those moments are related to tasks/projects/clients via links to their own tables.
In the Moments table, i also calculate the duration of the moment in seconds and from that extract it in hours and minutes (“10h13”).
Thanks to link, rollup and formula fields, i can automatically obtain the duration summed up by tasks/projects/clients in their own tables.
But i can’t find a way to automatically obtain those duration subtotals by year/month/week/day.
The problem i encounter is this:
When i create a moment, i choose (or create if needed) a task with its project/client related data. Then the link/rollup/formula fields do their thing in the related tables.
For the year/month/week/day data, i can do the same as the tasks/projects/clients data:
The solution i came with for now is to fill those link fields (year/month/week/day) in the Moments table in batch once in a while, with copy/paste: copy a value in a cell of a linked field, paste it in a selection of empty cells. But it’s more of a hack than a proper solution.
What i learned from that little experiment is that for now it’s complicated to make automated reports from tables in Airtable.
May be i looked at it the wrong way and there is a much elegant way to solve this, but i couldn’t figure it :confounded:
Anyway thanks to everyone that have been reading my long and complicated posts!
Jul 08, 2016 07:28 AM
The same feeling here!
Aug 24, 2020 06:21 PM
If you’re looking for a way to automate this copy/pasting process, we’ve built an extension that handles this on your behalf.