Hey everyone, I’ve been frustrated with the following scenario for a few hours. I’m sure there is a simple way to do this, but somehow my brain isn’t functioning right now Maybe someone has an idea.
Data Types:
Project
Name
Hourly Rate
Timer Session
Seconds
Project
A user has multiple projects with different hourly rates.
A user has many timer sessions.
I want to calculate the total earned from all projects combined.
“Total earnerd from all projects: $xxxx.xx”
Is there an efficient way to get that total number?
Hi there, @semikolon… if I understand your post correctly, I might go with a total earned field on the Timer Session data type that I would keep updating with the latest total for the associated project. With that field in place, getting a user’s total earned for all of their projects would be a simple sum of the total earned field for all Timer Session things that have been created by the current user.
Hey Mike, thanks for responding!
That seems to be the only solution that makes sense.
It just adds quite a bit of housekeeping in cases where the users later edits the hourly rate of a project and I then need to update the total for each timer session, but seems to be the only logical way