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

Creating a Range Formula

Faronnj
8 - Asteroid

Good Afternoon Alteryx Community,

 

I am trying to use some sort of formula to determine if the outcome of a follow-up is within our target range.  I will show you the data and then explain what I am trying to do further.

 

LastAge IOL Impl (yr)> 1-2yrs Sph
12.40.5
23.5-1.5
34.61.5
45.50
56.4-2.5
67.5-2
77.30.5
84.3-0.5
98.22.5
109.11.5
1110.41
12110.5
1312.61
1413.70.75
1514.4-3
1615.81.5
1716.4-1
1817.30.25
1918.70
2019.30.5

 

Okay, So we have 2 different targets:

1) for children under age 8, our target is with -2 to +2 

2) for children over age 8, our target is -1.50 to +1.50

 

Next, I want to know the number within the target and number outside the target (in each age cohort + total). Plus, I want to know the percent within the target range (in each age cohort + total).

 

I am lost as to where to start, I have been making unbelievable progress with your help and I recently showed one of your healthcare sales engineers all the work and he was extremely impressed with the progress in 2 weeks... which I explained to him was largely because of the forums help.  

 

Anyway, if you could please provide a workspace so I can see all the formulas and save them for future use I would greatly greatly appreciate it. 

 

Thank you again in advance and if you have any questions please feel free to ask,

 

Nick 

3 REPLIES 3
neilgallen
12 - Quasar

What you're looking for is a simple if statement. All available functions are HERE. 

 

if

[Age IOL Impl (yr)]<8 and [> 1-2yrs Sph]>-2 and [> 1-2yrs Sph]<2 then "In Target"

 

elseif

[Age IOL Impl (yr)]<8 then "Out of Target"

 

elseif

[Age IOL Impl (yr)]>8 and [> 1-2yrs Sph]>-1.5 and [> 1-2yrs Sph]<1.5 then "In Target"

else "Out of Target" 

 

endif

 

 

after that a summarize tool will get you there.

fmvizcaino
17 - Castor
17 - Castor

Hi @Faronnj ,

 

Attached is an example workflow showing how to accomplish what you need.

fmvizcaino_0-1579726308314.png

 

 

LEt me know if that works for you.

Best,

Fernando Vizcaino

afv2688
16 - Nebula
16 - Nebula

Hello @Faronnj,

 

Does this look ok for you?

 

I added the count per group (<8 or >8 and taking into account the other parameter) also added the percents:

 

Sin título.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

Labels