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.
SOLVED

Calculate median & quartile values for each group

imazhary
5 - Atom

Hi all, 

 

Alteryx beginner here so apologies if this is something very simple but would appreciate any help.

 

Essentially I am trying to find the median and quartile values for each activity and return it to a new column, e.g. in the example below I would expect all staff completing activity 1 to have a value of 2.288 in the median column.

 

Alteryx example.PNG

 

 

 

 

 

 

 

 

 

 

Example file attached.

 

Thanks in advance!

2 REPLIES 2
cmcclellan
13 - Pulsar

The answer is 2.2875 if you only consider the first 9, the answer is different if you look at everything

 

2019-04-18 21_34_26-Alteryx Designer x64 - median demo.yxmd.png

danilang
19 - Altair
19 - Altair

hi @imazhary 

 

Like @cmcclellan mentioned the median values differ when you look at the entire data set.  Part of this is because of the extra data in your full data set. The other reason is because you have an even number of values in all of your activities.  When this happens, there is no single median value so the 2 middle ones are averaged.

 

Here's a workflow that gives you the median and the quartiles (25th and 75th percentile) joined back to the original input.

 

 

WF.png

 

Results.png

 

Dan

Labels