Hello DB maverics!
I’m creating a Diet Tracker and would like to serve the users some insights, such as which weekday is the leanest/fattest. I know how to do this in SQL :
#SQL Pseudo code
select AVG (totalCal), DATEPART(weekday,foodDate) …
GROUP BY DATEPART(weekday, foodDate)
Ah ok, no probs. So in your editor, under the settings, General tab you’ll see this…
The drop down has an entry for Everyone can view/edit. If you change that then give us the URL we can take a look. If you’re not comfortable putting the URL in this post for all to see, just send me a message - or you could clone your app and share the cloned version.
I’ve added some additional data to the bottom of your Calendar page which I hope will help. It’s not quite finished and I don’t think I’ve managed to do exactly what you wanted, I was more playing with the data and trying to manipulate it somewhat to get values out in different formats.
I’m running out of time this morning, but I hope something in there will help anyway. I may come back to it later.
The more I look it the more my brain starts to hurt!
On page load I create some DOTWsum records, which is the average of a particular day for the months. It uses an advanced filter by extracting the day (0= sunday, 1 = monday etc) and does this a few times (expand it to 7 yourself).
Then the page shows the highest DOTWsums total and day (convert it to Day of the week yourself).
On page load, if you delete all DOTWsums for this user it will clear it down, and you then need to add the user as a constraint on the search.
Hope that makes sense. It is a bit of faff, but using a temporary table should work ok.
The filter method, that you both used was new to me. Thanks for showing me the way.
NigelG: You do the setup in the page loader. What if the values change during the page is used (tapping on the dates in the calendar displays an edit pop-up)?
Great stuff guys. I finish it up and we can all enjoy the end product.