Forum Discussion

veranceftw's avatar
veranceftw
Helper II
4 years ago

Rolling Mean Average

Hello, I have a dataset that looks like this:

 

datetimevalueworker_id
2021 01 0710.214562
2021 01 07100.114562
2021 01 07150.4514562
2021 01 07220.0515452
2021 01 07290.0115452
2021 01 0850.2355641
2021 01 0890.4555641
2021 01 08130.6355641
2021 01 08160.8755641
2021 01 08210.25123
2021 01 09160.001655
2021 01 09330.00541541
2021 01 09450.5641541
2021 01 09460.9841541
2021 01 09520.4741541
2021 01 09570.5341541
2021 01 1010.141541
2021 01 1030.3541541
2021 01 1050.2541541
2021 01 1070.8941541
2021 01 10110.2441541
2021 01 10130.2241541

 

Each user has a certain value throughout the time on a certain date. 

 

I would like to get the rolling mean average at every 3 values per user following the date/time order.

 

Thank you! 🙂

 

 

3 Replies

  • The output would be the rolling mean average per user with window = 3.

     

    I don't know why the date is messed up in the post but it should look like this:

     

    Actions are ordered by date and time, the rolling mean average should be calculated at every 3 actions. 

     

     

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Super User

      Hi,

      I still do not understand your requirement.  Someone else who does will help you.