Skip to main content

Hi All,

 

I have a table which has a timestamp every one hour. 

 

I would like to create a 4 week rolling average considering the following -  the last 4 timestamps for the same day of the week and for the same hour. 

 

As an example - 

 

To calculate the rolling average for date 1/26/20 0:55 (Sunday 0.55 hrs)  its value will be null as it has no other previous values to compare.

For the next Sunday and at 0.55 hrs  2/2/20 the value will be the previous value of 11.69. 

For the next Sunday 2/9/20 at 0.55 hrs the value will be the average of 11.69 and 3.67 which is 7.655

For the next Sunday 2/16/20 at 0.55 hrs the value will be the average of 11.69, 3.37 and 6.07 which is 7.1266

For the next Sunday 2/23/20at 0.55 hrs the value should be the average of 11.69, 3.37,6.07 and 5.87 which is 6.81

For the next Sunday 3/1/20 at 0.55 hrs the value should be a average of 1.69, 3.37,6.07 ,5.87 and  which is 6.79

 

Can anyone please suggest how can I calculate the Rolling average values in Tableau.  Attaching the sample table.

 

Regards,

Rishi Saka

3 respuestas
  1. 7 mar 2020, 1:07

    Here it is:, Not a direct table calc, but indirect way to do this:

     

    Here it is:, Not a direct table calc, but indirect way to do this: Compare it with your data:ThanksDeepakIf it Helps, Pl Mark it Helpful and CORRECT to Close Thread

    Compare it with your data:

    pastedImage_1.png

    Thanks

    Deepak

    If it Helps, Pl Mark it Helpful and CORRECT to Close Thread

0/9000