Average LAST 4 weeks by day

Attempting to create an average of a MONDAY over 4 weeks 
So AMOUNT 1, AMOUNT 2, AMOUNT 3, AMOUNT 4, FOR DAY / 4 
But It seems to just average everything -
This is the measuer - mean(${payments.amount})

 

81d22ed1-1e42-4efd-865a-949389fbedf8.png
0 3 207
3 REPLIES 3

Hi, 

Not sure how your weeks are defined as we are seeing hours of the day in your view. If it is already pre-filtered to last 4 weeks and you need to average the whole row then you would just need to do this:

mean(pivot_row(${payments.amount}))

If you need to calculate specific columns, then you would need something like:

(pivot_index(${payments.amount},1)+pivot_index(${payments.amount},2)+pivot_index(${payments.amount},3)+pivot_index(${payments.amount},4))/4

This would add the payments.amount in column 1, 2, 3, 4 and then divide it by 4. 

Hope this helps

Hi, 

Not sure how your weeks are defined as we are seeing hours of the day in your view. If it is already pre-filtered to last 4 weeks and you need to average the whole row then you would just need to do this:

mean(pivot_row(${payments.amount}))

If you need to calculate specific columns, then you would need something like:

(pivot_index(${payments.amount},1)+pivot_index(${payments.amount},2)+pivot_index(${payments.amount},3)+pivot_index(${payments.amount},4))/4

This would add the payments.amount in column 1, 2, 3, 4 and then divide it by 4. 

Hope this helps

Hello!
Thankyou for your assistance, 
This is sort of on the right track
 

7514457f-6395-4d91-8741-665b215917ea.png

My search range is 4 weeks, im looking to:
average the past 4 weeks of
Monday-Sunday
for each time 11,12,13,14,15,16,17,18,19,20
To produce an average 4 weeks of DAY at the TIME
So for an example

Monday 11 would be: $3,463.13  / 4
Monday 12 would be: $4,977.36 / 4
And so on, does that make sense?

Then all you need is a table calculation ${payments.amount} / 4   and then hide the measure and only show that table calculation

Top Labels in this Space
Top Solution Authors