Jump to content

Trying to get a filtered field sum from a table and store it as a variable (Virtual Field).

Recommended Posts

I have an employee document submission form. This table has a field  called [@field:hours]. Would like to have a virtual field which tells how many cumulative hours for a specific [@employeeID]. Would like the field to auto populate once the submission form is accessed. In other words, as soon as I select the employee from the results page, would like the details page to calculate how many hours this employee has.  Thanks for your help.


After Re-Reading my explanation. I could have simplified by saying, utilizing JavaScript,  how do you sum a column and store the result in a field ?

Link to comment
Share on other sites

12 hours ago, Accountability said:

From the same table.  Thanks for responding.

I would use SQL query in calculated field on details page. E.g.:

sum(hours) from table_name where user_id=targer.[@field:userid]

Calculated field generates a value on the fly on every page load (therefore it's always up-to-date), but if you need to save it in table you may use solution from this post

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...