Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!
The Product Idea boards have gotten an update to better integrate them within our Product team's idea cycle! However this update does have a few unique behaviors, if you have any questions about them check out our FAQ.

Alteryx Designer Desktop Ideas

Share your Designer Desktop product ideas - we're listening!
Submitting an Idea?

Be sure to review our Idea Submission Guidelines for more information!

Submission Guidelines

Count Function

PLEASE add a count function to Formula/Multi-Row Formula/Multi-Field Formula!

 

I have searched for alternatives but am just confused about how to store the result for the total number of rows from Summarise or Count Records in a variable that can then be used within a Formula tab. It should not be that difficult to just add equivalents to R's nrow() and ncol().

6 Comments
MarqueeCrew
20 - Arcturus
20 - Arcturus

@helfenbeind,

 

When I have this need, I count the number of rows and append that value to every record (Append Fields).  

 

Cheers,

Mark

helfenbeind
6 - Meteoroid

Thanks for your reply, @MarqueeCrew.

MarqueeCrew
20 - Arcturus
20 - Arcturus

That would be a good idea to suggest.  Please do.

 

https://community.alteryx.com/t5/forums/postpage/board-id/product-ideas

 

Cheers,

Mark

RachelW
Alteryx Alumni (Retired)
Status changed to: Comments Requested

Thanks for adding this idea @helfenbeind. I'm looking into adding some functions to Formula and will add this one to my list to consider. Can you tell me a little more about how you'd use this function? What problems would you solve with the function? Specific examples would be helpful. 

Iggypop
8 - Asteroid

@MarqueeCrewHow would you apply that when you need to count the number of rows by ID? For example, I transposed a set of columns into rows for a single record and now have 27 records. However that record has sales numbers which should be the total, but is now duplicated. 

 

 

I would typically just count the number of rows by each grouping, then divide the sales number by that count in order to get a fractioned number so as not to mess with the numeric data.

MPohlers
8 - Asteroid

A count function in all formulas would be nice.

@jdunkerley79 has created one in his formula add-on package.
https://community.alteryx.com/t5/Engine-Works/An-Overview-of-the-Alteryx-Abacus-Add-In/ba-p/398982#

Count makes functions easier:

A:

COUNT([A],[B],[C],[D])

vs.

B:

if isnull([A]) then 0 else 1 endif +
if isnull([B]) then 0 else 1 endif +
if isnull([C]) then 0 else 1 endif +
if isnull([D]) then 0 else 1 endif