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

Create new row for each value in fields (excluding nulls)

paulb1
8 - Asteroid

Using the dataset below as an example.  I need to be able to create a new row for each condition for each ID

 

IDNameCondition 1Condition 2Condition 3Condition 4Condition 5
101Test 1 NameChronic Medical Condition Learning disabilityAttachment difficulties 
102Test 2 Name    Family discord
103Test 3 NameChronic Medical ConditionNeurological conditions Attachment difficulties 
104Test 4 NameChronic Medical ConditionNeurological conditions   
105Test 5 Name  Learning disability Family discord

 

Like this:

 

101     Test 1 Name     Chronic Medical Condition

101     Test 1 Name     Learning disability

101     Test 1 Name     Attachment difficulties

102     Test 2 Name     Family discord

103     Test 3 Name     Chronic Medical Condition

103     Test 3 Name     Neurological Conditions

103     Test 3 Name     Attachment difficulties

Etc.

 

Please and thank you.

 

Paul

3 REPLIES 3
BenMoss
ACE Emeritus
ACE Emeritus
Check out the transpose tool, your key fields will be your name and ID field, and your data fields will be all of the different conditions.

After your transpose you can use the filter tool to remove rows which are NULL or empty to leave you with the data you require.

Give this a try and let us know if you need further help.

Ben
tcroberts
12 - Quasar

Hi,

 

You can accomplish this using the Transpose Tool along with a filter. I've attached a sample workflow below:

 

crosstabwithblanks.PNG

 

You may not need the cleaning step, and can potentially sort on Null() instead of looking for empty records, depending on the input data.

 

Let me know if this helps, or you need clarification.

paulb1
8 - Asteroid

Thank you kindly!  Works like a charm.

Labels