Forum Academy Marketplace Showcase Pricing Features

Sum Data for Specifc data using Date Picker

Hello, I am trying to build an app that calculates multiple health data points such as total calories. For example, I have 3 submissions in the database for calories on 12/24/2021. I would like to be able to use the date picker to pick a date and then have a dynamic text function to show the summed total for the 3 calorie submissions and when a new date is chosen it will show the summed total for all calorie submissions for that date.

Any ideas on how to format the dynamic data to do this? I tried using the group and aggregation function but it didn’t work the way I tried to set it up.

Thanks,
Allen

Hi there, @allen.archuletajr… if I understand your post correctly, here is one way to go about doing what you have described.

Let’s assume you have a data type called Calories, and you have a field in that data type called total calories. We’ll also assume you have a date/time picker on the page called Calories Date/Time Picker. With that set up in place, a text element with the following expression should produce the desired result… Search for Calories:each item's total calories:sum… and the search should have the following constraints… Created Date > Calories Date/Time Picker's value:rounded down to date and Created Date < Calories Date/Time Picker's value:rounded down to date +(days):1.

Hope this helps.

Best…
Mike

Mike that worked perfectly! Thank you so much I was banging my head against the wall on this one!

Best,
Allen

1 Like