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

Multirow If formula looping until all nulls removed

Rachael_OS
8 - Asteroid

Hi all! 

 

I'm having a bit of difficulty trying to create a looping multirow if formula. Basically, if a cell is null, I want it to take the data from the previous cell that contains data - e.g. in the below example I would like to fill banana hat down as far as car, car as far as factory, etc. I'm going around in circles trying to do this - the best I've managed is to get the first null removed for each category. All help gratefully received!! 

 

Col Header
banana hat
null 
null 
null 
null 
car
null 
null 
factory
null 
null 
null 
null 
null 
null 
null 
null 
pink

 

4 REPLIES 4
JoshuaGostick
11 - Bolide

HI @Rachael_OS,

 

This configuration should help with your issue.

 

Multirow If formula looping until all nulls removed.PNG

 

The formula is:

 

IF IsNull([Col Header]) THEN [Row-1:Col Header]
ELSE [Col Header]
ENDIF

 

Let me know if you have any issues!

 

Thanks,

Josh

Rachael_OS
8 - Asteroid

Hey Josh,

 

Appreciate the super quick response! I've tried this, but unfortunately it only replaces the first null instance - see e.g. below. I'm trying to remove all null values - is there a way to maybe amend the formula to do this?

 

Col Header
banana hat
banana hat
null 
null 
null 
car
car
null 
factory
factory
null 
null 
null 
null 
null 
null 
null 
pink
OllieClarke
15 - Aurora
15 - Aurora

Hi @Rachael_OS If you clean the column before the multi-row formula then it works as expected. First Trim the field to remove any leading or trailing spaces, and second replace 'null' with NULL() (i.e. make your null fields actually null)

OllieClarke_0-1573749481940.png

Rachael_OS
8 - Asteroid

This combo worked - thanks both!! 

Labels