Start Free Trial

Alteryx Designer Desktop Discussions

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

How to get a running count on a column

xqccc
5 - Atom

For example, I have col A like below and I would like to get the count column. 

Col A   Count

A             1
B             1
C             1
D             1
A             2
E             1
B             2
F             1
D             2

A             3

In excel, the count column can be get by formula "=countif(A:A,A1) and then copy this formula down. How can I achieve the same result in Alteryx without changing the sequence of the data(not using sort). Thanks!

7 REPLIES 7
alexnajm
18 - Pollux
18 - Pollux

Have you looked at the Running Total tool? That’s your best option - just make sure to create a column of 1 for each row so you can sum up. 

if you need to keep the order, add a record id tool beforehand, do what you need, then sort your data back on that record id column

Raj
16 - Nebula

@xqccc find the workflow attached
Mark done if solved.

flying008
15 - Aurora

Hi, @xqccc 

 

FYI.

 

录制_2025_01_06_15_35_01_214.gif

Qiu
21 - Polaris
21 - Polaris

@xqccc 
If you really hate the Sorting tool😁, we can use a Batch Macro as below.

0106-xqccc-.png0106-xqccc-B.png

aatalai
15 - Aurora

@xqccc this should work, uses similar logic to @flying008 but uses multi row rather than tile tool

nagakavyasri
12 - Quasar

@xqccc One way of doing this:

 

Screenshot 2025-01-06 171042.png

xqccc
5 - Atom

Thanks everyone! I can't use the sort tool. I think the macro solution works for me. Really appreciate all your help on this topic! 

Labels
Top Solution Authors