We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to repeat a value in a column based on the value from another column

jdbustamantec
6 - Meteoroid

I have the following table

 

NameCode
A 
A1
B 
B2
C 
C3

 

some rows have nulls in the code column and I want to repeat the same value as the row below if the value in the name column is the same. Below the results I'm expecting:

 

NameCode

A

1
A1
B2
B2
C3
C3

 

Any ideas on how to do this? Thanks

4 REPLIES 4
FrederikE
13 - Pulsar

Hey @jdbustamantec,

 

Multi-Row does the trick:

 

IF IsNull([Code])
THEN [Row+1:Code]
ELSE [Code]
ENDIF

 

Make sure to tick "Group By" Name to achive this: " if the value in the name column is the same."

 

See the attached example.

salvador_ian
7 - Meteor

Hello @FrederikE

I have the same question as @jdbustamantec .

But on my data, I think I would have to use both Row-1 and Row+1. Is there a way to do this using 1 tool? 

NameCode
A 
A

1

A

 

B 
B2
B 
C 
C3
C 

or is there any smarter way to do this if I have multiple columns that needs similar method?

NameCodeCode2Code3
A X 
A

1

 

 

A

 

 

Y

B  Y
B2X 
B   
C  Y
C3  
C X 

Thank you in advance!

 

PangHC
13 - Pulsar

use summarize and concate the value? remove the delimiter of course. 
but this only apply it only have 1 value each.

salvador_ian
7 - Meteor

ohh your right! thank you for the idea!
I can just use the Join tool to add the concatenated columns again. 
Tested it and works, Thank you!

Labels
Top Solution Authors