Alteryx Designer Desktop Discussions

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

Count record when find similar variables

dchandler
5 - Atom

Hello,

 

Hope you can help me to find out what tool can I use to add a column where it Counts 1 when find an unique record based on 4 variables and count 2+ when find a duplicate record based on the same 4 variables.

 

Please see the image below:

 

Capture.PNG

 

There are 3 records with the same value at Num_Cheque, di_institucion, di_nombre and Min_Fecha Proceso. I want to add a column that shows a 1 in the row of the record # 11, a 2 to the record #12 and a 3 to the record #13.

 

Thanks a lot, greetings from Panama.

3 REPLIES 3
JohnJPS
15 - Aurora

Greetings from Wisconsin!

 

I believe the Multirow Formula tool will work for this. Make sure to sort by the column you're assessing first; then use the Multirow Formula to you create a new variable, say "rank", with default of 1 unless your assessed"m variable is the same as that of thr previous row, in which case you take the previous row's new variable ("rank") + 1.

 

Hope that helps!

vishwa_0308
11 - Bolide

Hi,

 

here is the solution :

 

Make a column say "count"==1 and then in multi-row formula you can compare like :

 

if [Row-1:ID]==[ID] and [Row-1:NAME]==[NAME] then [Row-1:Count]+1 else [Count] endif

 

this will count further if same no. of records exists in rows.

dchandler
5 - Atom

Thanks a lot! Both answers helped a lot to understand how to figure it out. The formula of vishwa worked... the only fix to the formula is: if [Row-1:ID]==[ID] and [Row-1:NAME]==[NAME] then [Row-1:Count]+1 else [Row-1:Count] endif 

Labels