Timesheet with formula

We have a Timesheet and I am trying to work out complete hours that someone has worked in a day. Please see image.

hours total formula.PNG

In the Hours Total column within the spreadsheet, the formula reads Row Z2 * 24

Then the Complete Hours gives me a number value and the formula within the spreadsheet reads INT(Z2*24)

My problem is, when in the form these two columns aren't showing, anyone know why this is the case? Do I need to take the formulas out of the spreadsheet and add them into Appsheet?

Solved Solved
0 4 169
1 ACCEPTED SOLUTION


@Gregorrrry wrote:

they aren't showing even with the formulas not in the spreadsheet


Presumably because you've marked them not editable. That's also what I observe for existing (although not new) rows for a table configured like yours.

Instead of calculating Total Time as an Initial value that then can't be edited (and isn't displayed for existing rows), perhaps you need it to be an App formula calculation. When I configure the columns like that, they're indeed visible in the form.

dbaum_2-1672505645678.png

New row (with no entries) not yet saved

dbaum_0-1672505548959.png

New row (with entries) not yet saved

dbaum_1-1672505583645.png

Existing row (with no time values) opened for editing

dbaum_3-1672506280484.png

Existing row (with time entries) opened for editing

dbaum_4-1672506462080.png

BTW, here's how I calculated Hours Total, which it sounds like you want to be a numeric--not duration--value. If you also need it to be a number (integer)--not decimal--value, use the FLOOR function.

TOTALHOURS([Time Total])

 

View solution in original post

4 REPLIES 4


@Gregorrrry wrote:

when in the form these two columns aren't showing, anyone know why this is the case?


In many AppSheet view types, empty columns don't display. If you're referencing a blank form for a row being newly added, then those columns are certainly empty until the row is saved to the data source, where they're calculated. If you're referencing a form for an existing row already populated with data in those columns, then confirm their Show if property is enabled.


@Gregorrrry wrote:

take the formulas out of the spreadsheet and add them into Appsheet?


This is generally preferable for multiple reasons. For example, it's the only way a column can immediately reflect data changes in the app on a device without waiting for syncing those changes to the data source and then the data source's calculations back to the device.

Thank you for your help again.

I am still struggling to figure this out as they aren't showing even with the formulas not in the spreadsheet.

This is what I have at the moment:

timesheet formulaa.PNG

Time total = leave time - arrival time which gives the 'Time Total. This works fine, however the client would like a number value returned.

Hence 'time total * 24' giving the Hours Total.

Then to calculate the complete hours I need the Hours Total formula to be 'INT(Z2*24)'


@Gregorrrry wrote:

they aren't showing even with the formulas not in the spreadsheet


Presumably because you've marked them not editable. That's also what I observe for existing (although not new) rows for a table configured like yours.

Instead of calculating Total Time as an Initial value that then can't be edited (and isn't displayed for existing rows), perhaps you need it to be an App formula calculation. When I configure the columns like that, they're indeed visible in the form.

dbaum_2-1672505645678.png

New row (with no entries) not yet saved

dbaum_0-1672505548959.png

New row (with entries) not yet saved

dbaum_1-1672505583645.png

Existing row (with no time values) opened for editing

dbaum_3-1672506280484.png

Existing row (with time entries) opened for editing

dbaum_4-1672506462080.png

BTW, here's how I calculated Hours Total, which it sounds like you want to be a numeric--not duration--value. If you also need it to be a number (integer)--not decimal--value, use the FLOOR function.

TOTALHOURS([Time Total])

 

This is amazing! Especially on New Years Eve!

Thank you.

Top Labels in this Space