Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

How to have add a counter for duplicates in a table

Highlighted
7 - Meteor

Hi all,

 

I have a set of duplicates in this table and am wondering how to create a counter which starts at 1 and then counts up for every duplicate of "File #" found. For example, my table looks like this:

 

File #CodeReg hours

117521

1530
1424200235
1424201035
1524120235
1524121040
1524121540

 

And I would like a counter that outputs something like this: 

 

File #CodeReg hoursCounter

117521

15301
14242002351
14242010352
15241202351
15241210402
15241215403

 

I tried using the multi row formula tool with "IF [Row+1:File #] = [File #] THEN 2 ELSE [ROW-1:Counter]+1 ENDIF" but it isn't really working and doesn't count past 2.

 

Any help at all is appreciated!

 

Thanks so much,

Akarsh

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @apaicanada,

 

You're right, this would be a simple multi row formula, all you would need to do is group on File # and ensure the "Values for rows that don't exist" drop down is set to "0 or Empty". The formula would be [Row-1:Counter] + 1

 

My configuration of the multi row formula is below:

image.png

 

The workflow looks like:

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

Labels