Hi Community! Long time reader, first term poster. I’ve tried to look through the community and youtube for this answer but I’m getting stuck.
CONTEXT
I’m creating an app for a doctor friend that allows people to track health incidents over time such as having an extreme headache, bad bowel movement etc. The idea is that the user can go back over the last few months and see ‘oh wow, I had 11 headaches last month and now only 3 this month, the extra water intake must be working!’
The data I’m collecting from the user via a form is:
- Type of problem (which is linked to a seperate table I have of category types, like headache, bowel/bladder, period pain etc).
- Severity / 10
- Basic notes - where they were, how they felt etc.
Data I’m automatically recording is:
- Date added
- user email (making them the row owner of the data and linking to their profile via another relation column)
In the same table, I am also idenitfying data using calculations like:
- Unique month and year (so they can filter to all ‘June’ incidents)
- Entry name - so they can differentiate between the items on a detail screen.
It looks something like this in the data:
The data is already linked to a row owner, so I know the right rows are shown on my layout. What I am now trying to do, is within an incident detail screen (i.e. Headache Entry, 21 June 2024 at 12:06) is collate all the incidents they have had of in that category and show it on a chart, so they can see:
- Total number of items &
- Average intensity of issue for that month
An example of my screen for items categorised ‘Headaches’ (and the ideal items) looks like this:
THE ISSUE
Glide seems to want to add the intensity/10 numbers together so it shows 27/10, whereas I want it to just show me the average intensity/10 numbers for a single month, and the number of incidents.
I tried to create a helper table with all the months of the year there and then linked it with a relation but as you can see it collects all issues & users for that month. Is there a way to split out the data so I can calculate, for a specific user, their number of headaches, bladder issues per month and the average intensity?
I could have gone about this all wrong, I also wondered if there was a way to do it from the user table. Hopefully this makes sense and let me know if it doesn’t! Thanks in advance.