Alteryx Designer Desktop Discussions

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

Merging or combining data in the columns

VK11
7 - Meteor

Hello All, I have the inputs in column 1 to column 13. I would like alteryx to search for the column which has got the data and if the data is same in more than one column then copy only one data and paste it in the result column. can anyone please help, I am new to alteryx. Thanks in advance

6 REPLIES 6
ed_hayter
12 - Quasar

Not the most efficient solution but you can do this at the row level with a formula tool and conditional statement:

 

IF !isempty([1]) then [1]
ELSEIF !isempty([2]) then [2]
ELSEIF !isempty([3]) then [3]
ELSEIF !isempty([4]) then [4]
ELSEIF !isempty([5]) then [5]
ELSEIF !isempty([6]) then [6]
ELSEIF !isempty([7]) then [7]
ELSEIF !isempty([8]) then [8]
ELSEIF !isempty([9]) then [9]
ELSEIF !isempty([10]) then [10]
ELSEIF !isempty([11]) then [11]
ELSEIF !isempty([12]) then [12]
ELSEIF !isempty([13]) then [13]
ELSE NULL() ENDIF

 

Effectively If the column is not empty then use the value otherwise check the next column along.

 

I have added a second file that does it slightly more dynamically finding the longest string in a given row and making that the result. Assuming the ones you dont want are always empty cells this should work

 

Qiu
21 - Polaris
21 - Polaris

@VK11 
We can go with a bit dynamic way.
I typically will do a Transpose when processing multiple columns data.

I do question that the result for Row#5 shall be null since "E" only appears once.

My solution also consider the case that more than one "Character" is appearing moret than twice.

0629-VK11.PNG

BRRLL99
11 - Bolide
VK11
7 - Meteor

Thank you so much ed_hayter it works now

VK11
7 - Meteor

Thanks for the clarification, even if it appears once, I would like to have E in the result. Would It work when I change the Value>=1?

Qiu
21 - Polaris
21 - Polaris

@VK11 
Yes, I think it will work.
If you still want the value even if it appears only once, then we can use an Unique Function to be simplier.

0629-VK11-r1A.PNG0629-VK11-r1B.PNG

Labels