Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Calculating Quartile via Excel Function

MN124
5 - Atom

Hi Team,

 

I am having an issue re-creating an Alteryx workflow that would accurately calculate the quartile data represented in the data below (Source Data), as required by the rules and regulations of my industry. Also see below, desired results (Table 2):

 

Source Data:

Company NameData
Company 1N/A
Company 2N/A
Company 319.64%
Company 41.29%
Company 519.79%
Company 610.35%
Company 74.57%
Company 88.94%
Company 93.15%
Company 108.03%
Company 1114.75%
Company 123.91%
Company 134.40%
Company 144.78%
Company 15-2.83%
Company 1611.30%

 

Table 2:

 Data
Max19.8%
Q311.3%
Median6.4%
Q13.9%
Min-2.8%

 

 

Q3 =AVERAGE(LARGE(IF(ISNUMBER(B3:B18),B3:B18,""), INT((COUNT(B3:B18)-1)/4)+1), LARGE(IF(ISNUMBER(B3:B18),B3:B18,""), INT(COUNT(B3:B18)/4)+1))

 

Q1 =AVERAGE(LARGE(IF(ISNUMBER(B3:B18),B3:B18,""),INT((3*COUNT(B3:B18)-1)/4)+1),LARGE(IF(ISNUMBER(B3:B18),B3:B18,""), INT(3*COUNT(B3:B18)/4)+1))

 

All data is coming from Column B, as used in the formulas above. The Summarize tool does not achieve the desired result, nor does the profiling tool.

 

Any help would be greatly appreciated. Otherwise my only option would be to stop overarching the workflow, manually input the formula, and re-input the new quartile data. 

6 REPLIES 6
Greg_Murray
12 - Quasar

Hi @MN124,

 

Have you checked out the basic data profile tool? It looks like it has everything you're looking for except median, but you can get that from the summarize tool. The quartile numbers a little different that what you have, so I am not sure it's using the exact same calculation, but it may be worth looking at.

 

Greg_Murray_0-1605300735028.png

 

MN124
5 - Atom

Thanks @Greg_Murray,

 

I've done some searching on other quartile related questions on the board and it led me to the tool you've linked. The sticking point is that I need to emulate the exact quartile numbers that some out of the formulas listed, as required by industry regulations. I've pleaded my case with much simpler, very close quartile calcs via the summary/data profile tool to no avail. 

 

 

Greg_Murray
12 - Quasar

@MN124,

 

Gotcha. Try this one. You'll definitely want to do some testing, but it should be a start.

Greg_Murray_1-1605303199902.png

 

Edit: Here is a simpler version too. The first version had a few redundancies.

Greg_Murray_0-1605303690270.png

 

 

MN124
5 - Atom

@Greg_Murray 

 

You're fast. That is looking really good. I will try to piece those concepts into my workflow.

 

Quick side - in my actual data set the source data is also divided into additional sub categories, example below:

 

GroupCompany NameData
ACompany 1N/A
ACompany 2N/A
ACompany 319.64%
ACompany 41.29%
ACompany 519.79%
ACompany 610.35%
BCompany 74.57%
BCompany 88.94%
BCompany 93.15%
BCompany 108.03%
BCompany 1114.75%
CCompany 123.91%
CCompany 134.40%
CCompany 144.78%
CCompany 15-2.83%
CCompany 1611.30%

 

If I wanted individual interquartile calculations for each independent group. Is that just an addition the summary tools via 'Group By - Group' on top of the Value (min,Q1,med,Q3,Max) calculation. An ideal output resulting like:

 

GroupMinQ1MedianQ3Max
A###############
B###############
C###############

 

Sorry, I used an incorrect starting point. This is part of a much larger workflow.

Greg_Murray
12 - Quasar

@MN124,

 

No worries. You have the right idea. The summarize tools would all need to group on the the [group] field, but there are a few other changes what would be needed as well. see attached.

Greg_Murray_0-1605539702962.png

 

MN124
5 - Atom

Got it up and running! Thanks!!

Labels