Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

How to calculate percentage of whole with string data

mattanderson
5 - Atom

Hello,

 

I have column of data containing results that are either pass, fail, or timeout. I want to show these as a percentage of the total records so one can see what percent are pass or fail or timeout. How may I go about doing this? I have tried to create a new calculated field in the data using the formula tool but can not seem to get a formula without an error. 

 

I am new to Alteryx and still trying to get a feel for the software any help is very appreciated!

 

Best,

 

Matt

3 REPLIES 3
patrick_digan
17 - Castor
17 - Castor

@mattanderson The frequency Table tool would do the trick if you have the predictive analytics installed. If you don't have it installed, then you should install it! http://downloads.alteryx.com/predictive.html

 

EDIT: For what it's worth, the frequency table tool is pretty easy to modify if you just needed the percentage. I'm attaching my modified version. It amounts to a transpose, a couple summarizes, join the data together, and then run your formula. The normal frequency table tool requires R (and the predictive analytics install) to make a nice histogram.

 

Let me know if you have any questions!

gc
9 - Comet

Or if you want something sooner than later, use the Summarize tool to Group By and then Count on your field of interest. You can then add a Total with the Formula tool, as well as do the division for the Count of each value by Total.

But the "right" answer is what @Patrick_Digan said. Mine is the lazy but maybe good enough option :)

SeanAdams
17 - Castor
17 - Castor

Hey @mattanderson

 

Firstly - welcome to the community - and congratulations on your first post!

 

As @gc and @patrick_digan mentioned, you can do this with the predictive tools very easily.

But if you need to just whip this together - here's a flow that works.   Take your data, count all records, and in parallel count records by category, then you can use a formula to calculate percentages.

 

Screenshots and sample workflow attached.

 

Have a good weekend

Sean

 

2017-05-21_21-02-27.png

2017-05-21_21-03-00.png

2017-05-21_21-03-21.png

Labels
Top Solution Authors