Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to combine columns filling the blanks with data from each other?

FabioP
8 - Asteroid

Hello everyone!

 

I have the situation bellow:

 

FabioP_0-1591964356052.png

 

I'd like to group the columns Group1, Group2, Group3 and Group4 in one column (can be a new).

How can I do it?

3 REPLIES 3
grossal
15 - Aurora
15 - Aurora

HI @FabioP,

 

You are looking for the Transpose Tool.

 

Select all columns besides the Group 1-4 columns. You'll get two new columns, one with the column name (Group1-4) and one with all the values. Use a Select Tool behind and rename the Value Column to 'Group 1' and deselect the 'Names' column. You'd also need a Filter tool to remove the null values.

 

I have mocked up a quick example:

 

grossal_0-1591965059541.png

 

Result

grossal_1-1591965077159.png

 

I'll attach the workflow for reference, let me know what you think!

 

 

Best

Alex

 

fmvizcaino
17 - Castor
17 - Castor

Hi @FabioP ,

 

There are several ways, but I'm sharing one that is dynamic and it wil work for any amount of groups that you have.

fmvizcaino_0-1591964783395.png

 

You can also solve this by using an IF THEN ELSE condition, but you would need to right one adicional ELSEIF for each group.

 

Best,

Fernando Vizcaino

 

Eli_B
10 - Fireball

It's Alteryx, so there is a hundred different ways to do it. Based off your data, this could be done with a Formula tool and a "If" statement. It would look something like:

 

Choose your group 1 field or create a new field:

If IsEmpty([Group 1]) THEN [Group 2]) ELSEIF

IsEmpty([Group 1]) and IsEmpty([Group 2]) THEN [Group 3] ELSEIF

IsEmpty([Group 1]) and IsEmpty([Group 2]) and IsEmpty([Group 3]) THEN [Group 4] ELSE "Needs Review" ENDIF

Labels