Calculations made easy

Lately while pushing for Unibase to be considered as a development platform I’ve been asked “What makes it different?”

I’m going to show you the series of calculations and how I assembled them.

But first, the problem. In our payroll system we want to automate calculating the inter shift gap and use it to possibly add a penalty payment. This is about calculating that gap.

In Unibase terms we have a table – timesheet. Part of the definition follows:

: timesheet
staff, 4
date, 8 DC
timeOn, 5 N2
timeOff, 5 N2
>
staff,date,timeOn
>
timesheetLast staff,date
>
>

: timesheetLast,timesheet