Take the sum of list items created in last 7 days

I have list of items, each has a field “calories”

I need grab every list item created in the last 7 days, and take the average of their calorie field.

Having some trouble figuring this out.

Also, I was trying to avoid a search operation. simply because i already have this list of items, it seems like it would be faster to do it this way. The items i’m looking for will always be the most recent items created.

If it matters, i’m using the average to populate a new “thing” in a recurring workflow

Your text box should have Dynamic text like this:

2018-08-23_00-26-04

1 Like

I’m not populating a text, in this case, i’m creating a thing. but, maybe this will still work. how are you bringing up "“last 7 days?”

or is that the name of your list?

It’s the name of the Repeating Group: “RG Last 7 Days”. This should also be available in a workflow instead of in a text box.

Maybe i’m missing something, it seems like this would take the average of every item in the list? But, i only want to include items created in the last 7 days. here is, what seems like the correct starting point for the expression i’m trying to create.

Sorry about the crazy filter, here is a better picture

Ahh. Sorry about that, I thought it was already filtered. You’re right it will Average all of them.

Here’s how to do it with an unfiltered list:

A caveat: This will give an average of the items, not the average per day. If you’re looking for that, you’ll need to group your filtered list.

I think thats what I was looking for, thanks!

This topic was automatically closed after 70 days. New replies are no longer allowed.