We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Organize data by months, need the "months" to be from the 20 of first month to 19 of next

RobMotiwalla
7 - Meteor

Hey All,

 

I am working with some data that comes in about 5 times a month, and I need to take the average based on the month. All of that is straightforward, but I have one set in which I need to take the average of the dataset from the 20th of the previous month, to the 19th of the current month, inclusive (for April data I need to take the average of all the numbers from March 20th to April 19th, inclusive). The final problem I am running into with this is that those specific dates may not be in the data, so it could start on the 21st and end on the 18th, if there were no data points for the 20th and 19th.

 

I know I could do this slowly and manually with the formula tool, but I am definitely looking for something more simple and dynamic than that.

 

Here is the dataset, and I need to find the average for Jan - March

 

RecordIDDateRegional avg
14/29/202315.25
24/21/202315.25
34/14/202315.25
44/7/202315
54/4/202315
63/31/202315
73/24/202314.88
83/17/202314.88
93/10/202314.75
103/3/202314.5
112/28/202314.25
122/24/202314.25
132/17/202313.75
142/10/202313.75
152/3/202313.75
161/31/202313
171/27/202313
181/20/202312.38
191/13/202312.38
201/6/202312.25
211/4/202311.75
2212/31/202211.25
2312/23/202211.25
2412/16/202211.25

 

TIA!

 

-Rob

5 REPLIES 5
tristank
11 - Bolide

Hi @RobMotiwalla 

 

So when you say you need to find the average for Jan to March do you mean the averages for Jan 20 - Feb 20th and so on? With the exception that those exact dates may not always be available?

RobMotiwalla
7 - Meteor

@tristank 

 

That is close, it needs to be Jan 20 - Feb 19. Then Feb 20 - March 19. Then March 20 - April 19

jfha97
7 - Meteor

Hey @RobMotiwalla 

 

Not sure if this works, as I did not spend much time on it, but a workflow around this logic should work. I tried to get the min closest to the monthly start date and the max closest to the end date.

 

I set 20 as the floor for the start date and 19 as the ceiling for the end date.

 

Hopefully this can help/point you in the right direction.

 

Best,

jfha97

smoosh
8 - Asteroid

Attached is a way that should work for you. 

RobMotiwalla
7 - Meteor

Thank you, @smoosh and @jfha97 !!

Labels
Top Solution Authors