Calculate averge creation date?

Hello bubble,

I have two date filed, Support ticket and Support ticket message with the following data structure:

Support ticket

Support ticket message

What I’m trying to accomplish is to calculate the average time it takes between when a support ticket is created and when a support ticket message (that has support message sender = yes, and is connected to the same ticket) was created.

If i understand correctly, i need to group the search or sort it? I’m not exactly sure but i’d like to display it as average time.

Thankful for anyone that can point me in the correct direction or has the answer :folded_hands:

I would recommend to convert those dates in UNIX timestamp format. Once done, you may apply any calculation to this list of - now - numbers.

1 Like

Hey @redvivi, thanks for your comment! Would you mind showing me more in detail?

Im bumping this, still trying to figure it out

1 Like

I think this post solves part of the problem
[Solved] How to show average duration - Need help - Bubble Forum

You can do a search for Support ticket message, format it to text and in the text do the subtraction between the 2 dates you want to compare, you apply split by with | and each item you convert it to a number and take its average

1 Like

Hi, thanks for your comment but how does this compare with the Support ticket message?

This one only creates a average of the tickets created i assume?

Subtracting the creation date of the Support ticket message with the Support ticket it is linked to. You do this in the format as text in the content to show field and with a delimiter of |

1 Like

Hmm i think i understand but would you mind writing it out because i cant seem to get it to work

Simplify your approach by updating the Support Ticket when the first message is sent with the information you need.

So you can have a field called “First Response” which is date AND then at that exact moment, create a field called “Time To Response” (number type) which will be (First Response) - (Creation Date): formatted as minutes

This will return the minutes as a number.

You can now look through all the Support Tickets and get the average minutes of response time. This works because there is only one “First Response” to a ticket so you don’t need to continually maintain this calculation for the life of the ticket.

1 Like

Hello @hi.luisacosta, thank you for your idea, i think this is actually the best way to do it as you say. Might also reduce some headache in the future… I appreciate your comment :pray:

1 Like