Grouped by help

Building a billing system that tracks hours billed each day and then calculates the dollar amount to be billed based off the hours. My problem is some people charge based on the total amount of hours worked each week. Example would be if a worker works less than 30 hours for the week they get paid a flat rate of $400 for the entire week. Where if they work 30 hours or more they get paid a flat rate of $1000 for the entire week.

I’m using the group by feature to be able to get the dates grouped down into individual weeks and am able to sum up the total hours for each week using the aggregation option. What I can’t figure out is then how to determine which weeks have a total hours of less than 30 and which ones have a total hours more than 30, and then also charge the correct dollar amount for each week.

Does that make sense?

No. :joy:

How’s your database structured? And your workflows relevant to this, how do they work?

I have a thing that holds the times a person works for each day.
Thing: Schedule
Fields: Date (to identify which day its for), date range to identify the hours), total hours (which gets calculated when they enter their times. Its done in minutes), person (to identify who is charging this time)

I also have a thing that is the rate. It holds the parameters for how to calculate how much to charge.
Thing: Rate
Fields: Part time(this is the amount the person gets paid if they work less than the calculated amount of hours for the week), full time (this is the amount the person gets paid if they work more than the required number of hours), hours (this is the number of hours the person has to work to reach the full time rate)

The last conditional item is where i’m having a problem. I have it grouped by date to break the schedule things into weeks.

I’d give you access to the app but I have an alpha tester using it right now and so it has personal information in the database. Hopefully can figure this out


How exactly do you store the hours in the thing “Schedule”? A screenshot of your data type Schedule will do.

This is the thing. When someone adds the child to the daily schedule it creates this thing

Is this what you were asking for?

This topic was automatically closed after 70 days. New replies are no longer allowed.