Alteryx Designer Desktop Discussions

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

Fill in Initial Postop

Faronnj
8 - Asteroid

Goodmorning Alteryx Community,

 

I have the following data:

 

LastPreop 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
1-9.500.00       
2-15.50  0.50     
3-15.500.50 0.25     
4-20.25    0.25   
5-15.00     0.75  
6-7.00      0.5 
7-5.00      0.25 
8-14.00 0.00 0    
9-15.0000.00 0    
10-10.00-0.50 0.00     
11-7.75 00     
12-7 -1-0.5     
13-15  11    
14-12.75  00    
15-18.75 1.25 -1.5    
16-20.00 2.00 1.5    
17-15.50  -1.00     
18-10.25    0.75   
19-10.750.25       

 

 

I want alteryx to create the following table but I dont know how to achieve this.  I want alteryx to fill in the postop 1-3mo period with the data from the future follow-ups that do have data.  However, if the 1-3mo period already has an outcome (value) in it, I dont want it to move the future follow-up data but leave it the same.  Sorry it is hard to explain but I hope you understand if you look at the 2 tables:

 

LastPreop 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
1-9.500.00       
2-15.500.50 0.50     
3-15.500.50 0.25     
4-20.250.25   0.25   
5-15.000.75    0.75  
6-7.000.50     0.5 
7-5.001.00     0.25 
8-14.000.000.00 0    
9-15.0000.00 0    
10-10.00-0.50 0.00     
11-7.75000     
12-7-1-1-0.5     
13-151 11    
14-12.750 00    
15-18.751.251.25 -1.5    
16-20.002.002.00 1.5    
17-15.50-1.00 -1.00     
18-10.250.75   0.75   
19-10.750.25       

 

I would greatly greatly appreciate if you attach a workspace so I can see the formulas and everything I need to do to achieve this and so I can save it for reference since I have to do this for several data.  Thank you again in advance,

 

Nick 

2 REPLIES 2
danilang
19 - Altair
19 - Altair

Here you go @Faronnj 

 

w.png

 

The trick here is transpose all the follow up columns so they end up in a single column.  After removing the blank rows, you copy the next row's value to the row if the 3 month value is blank.  Remove the non 3 month rows from the transposed data and join on Last.  Then you copy the new field into the 3 mo column, giving

 

r.png

 

BTW: Unless there's an extra rule that you didn't mention, the value for row 7 should be 0.25 as opposed to the 1 in your sample output.

 

Dan

Faronnj
8 - Asteroid

No other rule, that was my mistake when I was filling in the data to show what I would like it to look like!  Thank you for all your help!

 

Nick 

Labels