Getting an average from a Calc Element

mwind454

New Member
All,

I am having difficulty returning an Average and Median from a Calc Element. I am using it to calculate time difference between when a ticket was created and today using strtotime. My returns to both AVG and MEDIAN are zero. Not sure what I am missing. Screenshots attached

Thanks
Chris
 

Attachments

  • calc-admin-list-view.JPG
    calc-admin-list-view.JPG
    39 KB · Views: 196
  • calc-list.JPG
    calc-list.JPG
    53.2 KB · Views: 206
  • calc-admin.JPG
    calc-admin.JPG
    45.5 KB · Views: 193
The list view calculation is based on whatever is in your database table. You can verify your list calculation using phpMyAdmin.

The calc element can be set to calculate on the fly for display purposes in list view, however, it only updates the database value when the form is saved. So this method doesn't work if you need list view calculations.

To make it work as expected, you'd need to update the data in your table with a manual query or work out other code to automatically update it as needed. There are a couple ways to do this, , e.g. a scheduled task or form PHP, it just depends on your setup and expectations.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top