Alteryx Designer Desktop Discussions

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

To calculate average in the same column

Polite123
8 - Asteroid

Hi Team,

 

Please help me with the below issue

 

I run the workflow everymonth and for example if I am running it for March month below is the input

 

Input:

 

March values are 0 when run for march month 

PointsMonths Values
AJanuary25
AFebruary5
AMarch0
BJanuary20
BFebruary6
BMarch0
CJanuary8
CFebruary5
CMarch0
DJanuary10
DFebruary2
DMarch0

 

Output:

 

For point A

March=(Jan+ Feb)/2=15

Similarly for point B,C,D

 

PointsMonths Values
AJanuary25
AFebruary5
AMarch15
BJanuary20
BFebruary6
BMarch13
CJanuary8
CFebruary5
CMarch6.5
DJanuary10
DFebruary2
DMarch6

 

When we run for April month,March values get updated and April values for point A should be average of Jan,Feb,March/3

 

example:

March data got updated and April month is now average of Jan Feb Mar

April=(Jan+Feb+Mar)/3=10.66 for point A

Similarly for B,C,D

 

Similarly I want to do this for all months when data gets updated every month

 

PointsMonths Values
AJanuary25
AFebruary5
AMarch2
AApril10.66667

 

Any quick help will be highly appreciated.

 

Thanks in advance:)

3 REPLIES 3
L_T
8 - Asteroid

Hi, 

would the attached workflow work?

 

KarolinaRoza
11 - Bolide

Hi @Polite123 ,

 

If I understood your problem correctly, every month after running the (first?) workflow you have new month added but with the values 0, right?

If yes, I used that information as starting point to exclude last month with 0 values, and calculate average.

 

Please let me know if it works for you.

Karolina

mceleavey
17 - Castor
17 - Castor

Hi @Polite123 ,

 

I've attached the workflow for you.

This is simply using the running total tool and dividing by the record ID -1.

 

M.

 

mceleavey_0-1618564236733.png

 



Bulien

Labels