Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Average of prior months

ryan14
6 - Meteoroid

I have a detail which shows cities in the rows and months in the columns with sales for each location for each month. I would like to set up a 3 month average based on the month we are currently in, and give the file the ability to move forward automatically based on the month were in. I understand how to manually input an average, but am unable to figure out a solution to have it move forward each month when we change months.

2 REPLIES 2
ryan14
6 - Meteoroid

Here is an example of what im working with... we are now in P6 so i would like an average of P3/P4/P5. but once we get to P7 P6 will be filled in via the input file, and then P7 would need to average P4/P5/P6.

SalesP1P2P3P4P5    

florida

100104108112116    
georgia101105109113117    

NC

102106110114118    
SC103107111115119    
          
          
          
          
          
kelsey_kincaid
12 - Quasar

Hi @ryan14 ,

A transpose tool would work well for this.  You can then sample the last 3 records (grouped by city), compute the average and then combine it back with the original data. I've mocked up a workflow below - let me know if this works for you or if you have additional questions.

 

kelsey_kincaid_0-1618940051879.png

 

Labels