Alteryx Designer Desktop Discussions

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

Use Multi Row or Formula tool to duplicate Excel's "Countif" Function

Rob48
8 - Asteroid

I'm looking for a one-step process to add a column with a count of each instance of a row's value like can be done with excel's "countif" function so that I get a return as in the below example:

 

Title 1Column I want
Apple1
Orange4
Orange4
Orange4
Orange4
Banana2
Banana2

 

 

I know I can do this with the Summary tool but it takes multiple steps and I'd like to get the count column in a single step.  I imagine it could be done with either the Formula or the Multi-Row tools but I can't figure out how.  Would love to see how it's done in both if possible.  Thanks for any help you can provide.

 

4 REPLIES 4
cmcclellan
13 - Pulsar

I would always use Summarize, because ... 

Formula is for single rows only

Multi-Row will work in the window that you define, but if you add more records it might not work correctly.

 

Summarize and then join back is the appropriate tools to use.

Rob48
8 - Asteroid

How would the multi-row configuration work?

 

caltang
17 - Castor
17 - Castor

You can just use a tile tool and group by the Title 1. The Tile_num gets you the order you desire. If you want to order it in a specific way, you can use a mapping table with a order ID, then map it as well. Else summarise and join back like @cmcclellan 's suggestion. 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Rob48
8 - Asteroid

regarding the Tile tool solution, I should have mentioned the data example I gave was simplified, but I will have more columns in my actual data.  The Tile solution Caltang provided doesn't seem to work with data more than one column.  I'm not familiar with the Tile tool so I may have configured it wrong....

Labels