community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Multi Row formula

Asteroid

Hi All,

 

There is a minor hiccup that I am facing in trying to create a logic. I would be glad if anyone can help me on this. The requirement is such that, I am sure I need Multi-Row Formula to fix it, but somehow i am unable to nail the formula. 

 

Let us say we have three columns as, Name, Month, Gender.

Name MonthGender
TomJuly 
TomAugustM
TomSeptember 
LucyMay 
LucyJune 
LucyJulyF
LucyAugust 
LucySeptember 

 

In the data shown above, i would like to fill the Gender column for each Name if there is an entry in any single row, similar to one shown below.

 

Name MonthGender
TomJulyM
TomAugustM
TomSeptemberM
LucyMayF
LucyJuneF
LucyJulyF
LucyAugustF
LucySeptemberF

 

Thanks

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner
There are a couple of ways to achieve this, one is using a multirow and the second uses a filter and join.

For the multirow formula to work you need to ensure the value populated is at the top. So use a sort tool to sort by name ascending and the gender descending (or whichever way brings the filled in gender value to the top line).

You should choose the 'update existing field' in the multirow formula tool and select gender.

The statement you want is relatively simple.

IF ISNULL([Gender]) THEN [Row-1:Gender] ELSE [Gender] ENDIF

You should also include name as a group by field.

An alternative method would be to add a filter tool and remove instances where gender is not NULL. Take this stream and use a join tool to bring the value against the entire data stream using name as the join field.

Ben
Asteroid

Thanks 

 

 

Alteryx Certified Partner
Alteryx Certified Partner

That's great to hear @Zaid!

 

Would you mind marking the post as a solution just so this post is prioritised when people are searching for similar issues.

 

Ben

Labels