We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Multi Row Formula

sariyaj
7 - Meteor

Hello, I'm having trouble with the multi row formula. I am trying make it so that if the row above it is a duplicate, I want it to add one, two, three, etc. 

for example:

Company CodeCompany Name
ABC001ABC Trucking
ABC001ABC Equipment
ABC001ABC Services
ABC001ABC LLC 

 

but I need it to look like this:

Company CodeCompany Name
ABC001ABC Trucking
ABC002ABC Equipment
ABC003ABC Services
ABC004ABC LLC 

 

Any kind of help would be appreciated. 

Thank you.

5 REPLIES 5
FinnCharlton
13 - Pulsar

Something like this might help:

FinnCharlton_0-1673888744299.png

 

sariyaj
7 - Meteor

I'm sorry but what is the multi Row formula you used?

FinnCharlton
13 - Pulsar

if [Row-1:Company Name]!=[Company Name] then tonumber([Row-1:New Field])+1 else tonumber([Row-1:New Field]) endif

 

This checks to see if the row above is a duplicate. If it is not, it adds 1 to the "New Field" column. At the moment if the row above is a duplicate, the formula just returns the same "New Field" value as the row above. This part could be changed depending on what output you want when there is a duplicate.

sariyaj
7 - Meteor

That worked great! Thank you so much!

binuacs
21 - Polaris

@sariyaj Another way of doing this with the tile tool

 

binuacs_0-1673904212225.png

 

Labels
Top Solution Authors