Start Free Trial

Alteryx Designer Desktop Discussions

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

How to fill null values with data in a before and after row

NadiaMazlan25
6 - Meteoroid

Hi all, I have a problem where I want to fill the null value with data from before and after the row. I tried to use a multi-row formula, but it can only be before or after. Is there any solution for this?

 

Input:

 

Screenshot 2025-03-05 104719.png

Desirable Output:

Screenshot 2025-03-05 104759.png

5 REPLIES 5
flying008
15 - Aurora

Hi, @NadiaMazlan25 

 

Update Existing Field with: 

 

 

IF IsEmpty([Name]) && [Row-2:Name] = [Row-1:Name] THEN [Row-1:Name]
ELSEIF IsEmpty([Name]) && !IsEmpty([Row-1:Name]) && !IsEmpty([Row+1:Name]) THEN [Row+1:Name]
ELSE [Name] 
ENDIF

 

 

 

录制_2025_03_05_11_21_23_740.gif

NadiaMazlan25
6 - Meteoroid

Hi @flying008 

 

I tried the formula, but I noticed the value for 'Company D' is replaced by 'Company E'

flying008
15 - Aurora

Hi, @NadiaMazlan25 

 

IF IsEmpty([Name]) && [Row-2:Name] = [Row-1:Name] THEN [Row-1:Name]
ELSEIF IsEmpty([Name]) && !IsEmpty([Row-1:Name]) && !IsEmpty([Row+1:Name]) THEN [Row+1:Name]
ELSE [Name] 
ENDIF
NadiaMazlan25
6 - Meteoroid

Hi @flying008 

 

Thank you. It works perfectly. For an additional question, what if there are 2 null columns above it? how to solve it?

 

Screenshot 2025-03-05 120716.png

flying008
15 - Aurora

Hi, @NadiaMazlan25 

 

Well , there is a full dynamic resolution for you , if you get your want, please mark it as a solution and give a like for more share.

 

Spoiler
Replace(REGEX_Replace([Name], '((?<=,)(?:<,)+([[:alpha:]\s]+),(?:<,)+)', '$2$1'), '<', '')

录制_2025_03_05_13_23_32_835.gif

 

Input  Output 
NameAddress NameAddress
Company BAddress 2 Company BAddress 2
 Address 2 Company CAddress 2
 Address 3 Company CAddress 3
Company CAddress 4 Company CAddress 4
 Address 4 Company CAddress 4
 Address 5 Company CAddress 5
Company DAddress 6 Company DAddress 6
 Address 7 Company EAddress 7
 Address 7 Company EAddress 7
 Address 7 Company EAddress 7
Company EAddress 7 Company EAddress 7
 Address 7 Company EAddress 7
 Address 7 Company EAddress 7
 Address 7 Company EAddress 7
Company FAddress 7 Company FAddress 7
Labels
Top Solution Authors