Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

'Rolling average' in text & image

I'm trying to show an average of the last 30 days work of data. I can't get it to work in Text and Image.

In a table, here's what I have:

rangeavg(top([my_field], 1, 30)

This shows my data in the table OK and calculates the correct average.

But I don't want this in a table, I want it in a Text & Image box. But when I put the same expression in Text & Image, I get a null output. My guess is that this has something to do with sorting. Of course, the documentation is of no help whatsoever.

The only other way I can think of doing this is to use firstsortedvalue 30 times, but this seems to be an awful solution. I thought of using a set expression, but I can't for the life of me work out what the set expression would be.

My underlying data is in this form:

Date, my_field

1 Solution

Accepted Solutions
ramoncova06
Specialist III
Specialist III

most likely is because it has more than one value, that the table box is not working

you can do set analysis this way

avg({< Date= {">=$(=(today()-30))<=$(=(today()))"}>}SHIPPEDQTY)

View solution in original post

1 Reply
ramoncova06
Specialist III
Specialist III

most likely is because it has more than one value, that the table box is not working

you can do set analysis this way

avg({< Date= {">=$(=(today()-30))<=$(=(today()))"}>}SHIPPEDQTY)