Calculating Quarterly Stats

I have an app that connects hosts and guests. (Think something like Airbnb.) I have a management dashboard and I want to calculate quarterly stats:

Change in the number of approved hosts.
Change in the number of approved guests.
Change in the number of completed trips.

Can someone point me in the right direction to set this up?

Many ways to do this.

If you’re wanting to do it quarterly then you’d have to know how many were in 3 months so you’d have have a field for approved date for when they were approved. A date for when they were approved guests and date of the trips.

You need to do a Search for all hosts with the constraint approved = yes, and then :filtered Date approved > current date and time: format to months : -3 <_ current date and time:count

Do the same for guests and completed trips.

Or if you want to keep a log of it, so you can go back through it, create a log datatype and a backend workflow to action every 3 months to total the approved guests, approved hosts and completed trips. Basically do the formula above in the backend API every 3 months

By change in the number of approved hosts you just mean number of approved hosts last quarter vs. this quarter right?

Just do a search for approved hosts last quarter minus approved hosts this quarter.

If your issue is around “how do I find a quarter?”
You’ll want to create a new Data Type named Quarter with field: Name of quarter, start date, end date. Then when you search for your host you say created date > search for quarter where current date > quarter start date and current date < quarter end date. (This gives you the current date).

Also I’m positive you could have gotten this answer from ChatGPT in 2 seconds :joy:

1 Like

Thank you, both! It was a LOT more complicated than what you wrote, but you pointed me in the right direction. I had been asking Gemini for help and was frustrated because I was mostly training it. Gemini doesn’t currently speak Bubble. I subscribed to ChapGPT and discovered it provides relevant, detailed help to build complicated things in Bubble. Here’s what I’ve done so far.