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

Multi-Row with Various Number of Rows

PWaicus
7 - Meteor

Hi - I'm trying to use the Multi-Row Formula tool to add an ID number to a set of records (the data will eventually be cross-tabbed, as the values will need to become the field names).  The challenge is that there is a different number of rows to group for each ID.  So using a standard +/- number of rows does not work, as each grouping could have a various number of rows in the raw data.  Essentially what I'd like to do is assign an ID number to all rows from where the value is "First Name" down through the last row prior to the next one with a value of "First Name".  Sample data is included in the attached workflow. 

 

Thanks! 

5 REPLIES 5
NickSm
Alteryx
Alteryx

@PWaicus 

 

Can work around the variable number of rows by first using a formula to create a marker whenever you come across a "First Name" entry.  Then your multi-row can just look one record above and see if it's null or was filled by the formula.  

 

Attaching a quick example workflow.

Thableaus
17 - Castor
17 - Castor

Hi @PWaicus 

 

Does a Multi-Row formula like this work for you?

 

IF [F1] = "First Name" THEN 1
ELSE [Row-1:ID] + 1 ENDIF

 

rowmulti.PNG

 

Cheers,

Claje
14 - Magnetar

Another version of this that uses one Multi-Row Formula - I created an integer field called RecordID but it should be pretty easy to change this.

 

IF [F1] = "First Name" THEN [Row-1:RecordID]+1 ELSE [Row-1:RecordID] ENDIF

 

JosephSerpis
17 - Castor
17 - Castor

Hi @PWaicus This syntax should work for you with the multirow toolMulti_Row_Formula.JPG

PWaicus
7 - Meteor

Thanks much!!!

Labels