Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Multi-Formula Shifting Cells & Utilizing Formula

Faronnj
8 - Asteroid

Good Afternoon Alteryx Community,

 

I have a multi-step problem that I will try to explain as clear as I can since the formula I have been trying with if clauses is not working.  I have attached my workspace so you can see what I am trying to achieve (focus on bottom workflow - the top is to show you why I have to do this).  Excel has a graph function to connect data points with lines and ignore the null values unforuntately alteryx does not to my knowledge. 

 

First Formula Goal: if the postop 1-3mo is empty then fill it with the next follow-up data value 

 

Second Formula Goal: as you can see from the top workflow - the chart needs values filled in to properly look right.  I tried to achieve this the second formula but I clearly have failed since its not averaging and its skipping some cells.  So it might need a full rework.  

 

I need it to look at the last follow-up and average it with the next follow-up and fill it into the adjacent cell and continue to do this so it fills in a value for every postop period between the final and initial postop 1-3mo followup:

 

To better show you, I took part of the data and did it manually with a before and after in excel.  

 

Raw Data:

LastFirstEyePreop IOL Ref SphPostop 1-3mo Sph> 4-12mo Sph> 1-2yrs Sph> 2-3yrs Sph> 3-5yrs Sph> 5-7yrs Sph> 7-9yrs Sph> 10yrs Sph
11OD-9.500.00    1  
22OD-15.500.75 0.50     
33OS-15.500.50 0.25     
44OD-20.25    0.5  1
55OD-15.00   1    
66OD-7.00  0.50  1  
77OS-5.00  0.50  1  

 

And here is what I would like alteryx to be able to do and where my formula is failing:

 

LastFirstEyePreop IOL Ref SphPostop 1-3mo Sph> 4-12mo Sph> 1-2yrs Sph> 2-3yrs Sph> 3-5yrs Sph> 5-7yrs Sph> 7-9yrs Sph> 10yrs Sph
11OD-9.500.000.500.500.50.51  
22OD-15.500.750.630.50     
33OS-15.500.500.380.25     
44OD-20.250.500.500.500.50.50.750.751
55OD-15.001.001.001.001    
66OD-7.000.500.500.500.750.751  
77OS-5.000.500.500.500.750.751  

 

 

I would greatly appreciate if you attach a workspace since these formulas get quite confusing and I am sure my formula has to be completely redone since its not doing exactly what I want right now.  Thank you in advance and if you have any questions please feel free to ask.

 

Nick 

6 REPLIES 6
fmvizcaino
17 - Castor
17 - Castor

Hi @Faronnj ,

 

Attached is an example showing how to get that done. It was not easy but I think I have nailed it! 

 

fmvizcaino_0-1579552253430.png

 

Take a look and let me know if that works for you.

Best,

Fernando Vizcaino

Faronnj
8 - Asteroid

@fmvizcaino I appreciate your hard work and i definitely hear ya with the headache this can give.

 

There is one error I encounter when utilizing this in my data, I have changed the data for patient 2 to show you what I am talking about.  It seems when there is a value, null, value, null, value - it averages and uses the formula on values that should not change from the original data.  

 

If you look at the 1-2yrs on patient 2, you will see it replaces the original value and calculates some other value when we want the original values to remain.  

 

Do you have any suggestions to correct this in the formula or something?  

 

Again, I greatly appreciate all your help and solving this complex problem but it is very helpful since I have to utilize this a few ways.

 

 

Faronnj
8 - Asteroid

@fmvizcaino wrong workspace, it didnt change the data for patient 2, this one does to show you the error. 

fmvizcaino
17 - Castor
17 - Castor

Hi @Faronnj ,

 

My previous solution was calculating only the case with one average possibility. I've attached now an example dealing with multiple averages for the same row.

 

Let me know if that works for you.

Best,

Fernando Vizcaino

Faronnj
8 - Asteroid

@fmvizcaino you are a wizard! thank you so much, this is really incredible and exactly what im looking for.

 

Nick 

fmvizcaino
17 - Castor
17 - Castor

Glad to help @Faronnj !! 

Please mark the answer as correct to help other with the same problem as yours.

 

Best,

Fernando Vizcaino

Labels