Skip to main content
Discover what’s possible with embedded analytics! March 6, 10 AM ET SIGN UP!
Showing results for 
Search instead for 
Did you mean: 
Partner - Specialist III
Partner - Specialist III

Calculate limited average for field's values


I am looking for non-trivial solution for my task:

I do have data table that contains some values (people's daily counts) for multiple locations over time (for ~3 years)

Screen Shot 2016-08-19 at 5.02.50 PM.png

I need to calculate (for each day) the Average Traffic 10 days prior and 10 days after the particular date.

It's easy to do in the chart:


  below(sum([Traffic Enters]), 0, 10),

  above(sum([Traffic Enters]), 1, 10)


But I need to do it in the script...

Yes, there is a way using GROUP BY, FOR TO - NEXT, PEEK, etc approach...

But I was hoping somebody could suggest a better and more elegant solution...

Looking forward to your suggestions!



Labels (1)
3 Replies

I think rather not. You will quite probably need a group by to get the sum per day and those result then matching with one or two peek-loadings (with different sortings to get the previous records from both sites) and afterwards a further aggregation to get the average.

Alternative to the mentioned peek-runs could I think on a kind of As-of-Table within the script (each day is there matched with the 10 days prior and after it) and which will be taken to flag the right days together. A different way might be to match the days simply to their RowNo in 20-buckets (but it will be difficult if there gaps between them).

In conclusion I think there would be alternatives possible but I'm not sure if they would be more elegant or better perform than the "classical" way.

- Marcus


Expecting O/P from above Data?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Partner - Specialist III
Partner - Specialist III


Not sure I've got your question..