Forum Academy Marketplace Showcase Pricing Features

Help! Need to show an Average time but down know how

I am having issues wrapping my mind around how to do this.
Say I have a thing… called Cases
A user creates new a case, there is a field called Case Status which has two options - open or closed.
I need to show on a dashboard the average number of days to closure for the cases…
But #1 I am not sure where/how to store the date/time when the case status field changed to close
#2 I don’t know how I can show on the dashboard page, what that average days to case close is (among all of the case statuses)

I hope this makes sense, can anyone help?

You should have a case open (date) and case closed (date) field. Even better would be to have a caseDays field (number).

That way, when the case is closed, you would take the difference in days between the case closed and case opened date fields.

Then, on a dashboard, you would do a search for all cases for that user, and avg the caseDays.

Learn no code →

Thanks Nocodify!
Question - is there a way that when the user selects the open or closed option in the case status field it would write the date to the case open date or the case closed date field (based upon which was selected) at the time the form is submitted? I don’t want the user to have to put the date in manually.

Yes - you can probably build in some only-when conditions into the workflow steps. I would have two steps

1 would be to create a new thing (the case) when they open it
Another would be to make changes to thing (the case) when they close it

Both would have an only-when condition depending on the biz logic.

Thank you so much, I was able to make a field with the days to closure for each of the cases using only-when called Cases Days Open.
Now I am trying to figure out how to average them all (Cases Days Open) and show them as the average amount of (days) to closure on a dashboard page… using just the average number as representative. I think I can use dynamic text, but no idea of the formula…

Use the built in field for ‘created date’ to let Bubble track the Case Created Date when the User creates the case in the application.

Use the backend workflow database triggers to setup an automatic workflow when the case status changes to ‘closed’…in that workflow calculate the number of days from the creation date to the status ‘closed’ date and save it to a data field that is a number.

Then you can more easily see and calculate an average number of days for all cases by that User. Search Cases constrained by created by = current user…then from the search results you can use the :sum operator and the ‘/’ using the search results.

Learn More

Boston85719 is an expert Bubbler with a decade experience as an educator. Real name Matthew, he has been actively building SaaS apps, marketplace apps, scheduling apps and more for clients, himself and for sale as templates.

As an official Bubble Bootcamp Instructor, he leads Bubble Bootcamps on a regular basis.

Always willing to offer advice via the Bubble Forum, Matthew also offers Private Personal and Group Training Sessions.

Through his site, NoCodeTrainer, Matthew provides a range of tutorials with editor access to help you jumpstart your Bubble development.

Always accessible you can send Matthew a private message via the forum or send an email directly with your requests.

Be sure to checkout the Stripe Integration Course when you are ready to integrate Stripe payments to start monetizing your application via product sales or subscriptions.

Stripe Integration Course

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