Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Calculation of average

Polite123
8 - Asteroid

Hi Team,

 

 

Need some quick analysis for the below data in averaging.Please suggest

 

Example:

I am running data for April month which should be average of above three months as shown below(Actually April data is not available...we have data till march).

 

MonthsValue
Jan2
Feb3
Mar4
April3

 

 

Now when I run data for May month(which is actually not there)...it should be average of above 4 Months as shown below(April data is now made available):

 

MonthsValue
Jan2
Feb3
Mar4
April6
May3.75

 

Similarly when I run data for June month,it should be simply average of above 5 months as shown(May data is now made available):

 

MonthsValue
Jan2
Feb3
Mar4
April6
May7
June4.4

 

 

Thanks in advance:)

10 REPLIES 10
atcodedog05
22 - Nova
22 - Nova

Hi @Polite123 

 

This is a slightly rather complicated scenario 😅

atcodedog05
22 - Nova
22 - Nova

Hi @Polite123 

 

Here is a workflow for the task.

 

Input:

atcodedog05_0-1602783082061.png

Output:

atcodedog05_1-1602783100232.png

It is designed to take next month of the last month and value as avg of all previous months

 

Workflow:

atcodedog05_2-1602783147787.png

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

Harbinger
9 - Comet

@Polite123 here is a tidier way to do it get there! 

 

Harbinger_0-1602785461739.png

I hope this helps! 

Polite123
8 - Asteroid

Hi @atcodedog05,

Thanks.But this seems to work for only May month and not for other months.

I actually needed it to be a continuous process.

 

While running for April---The value for April should be average of Jan,Feb,Mar

While running for May---The value for May should be average of Jan,Feb,Mar,Apr.

Similarly for all months except for Jan every year which is a fresh month.

 

Can this be implemented in some way may be?

 

 

Thanks in advice

atcodedog05
22 - Nova
22 - Nova

Hi @Polite123 

 

It is built in a way that it will calculate next month based on the exiting data.

 

Output  (case 1): Months till April so calculating May

atcodedog05_0-1602835081139.png

Output (case 2): Months till May so calculating Jun

Capture4.PNG

Workflow:

Capture5.PNG

Please check and let me know

atcodedog05
22 - Nova
22 - Nova

Hi @Polite123 

 

For the scenario when next month is Jan its not added.

Input and will remain same and gives a warning.

 

Input:

atcodedog05_0-1602835959434.png

Output: Input and output are same and it will give a warning (could be changes to error also.)

atcodedog05_1-1602835983684.png

 

Hope this helps 🙂

Polite123
8 - Asteroid

Hi @atcodedog05 ,

 

Yes you are correct but the problem is I have a file which has all months included in them and for example while trying to calculate data for March month,the average is getting reflected in the highest month and not in March month because the workflow is built that way(you have added a formula)

 

Requirement:

I have list of all months mentioned in the file and the average must be calculated for the respective months.

 

Any help would be highly appreciated.Thanks:)

atcodedog05
22 - Nova
22 - Nova

Hi @Polite123 

 

Hmm i think i have got a idea now. Will work on it and post it shortly

atcodedog05
22 - Nova
22 - Nova

Hi @Polite123 

 

Here is a workflow which calculates months value considering prev months average.

 

Input:

atcodedog05_0-1602837547681.png

Output:

atcodedog05_1-1602837564741.png

Make sure you have a column year so that Jan get reset each time as part of year start.

And there are few extra columns which will help you validate.

 

Workflow:

atcodedog05_2-1602837625121.png

 

 Hope this meets the requirement 🙂

Labels