Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Calculating the percentage of a column with different categories

sriniprad08
11 - Bolide

Hi Team,

 

I have an excel file containing the data with different column. I want to calculate the percentage of particular column with different categories. Say the column has 3 categories. Then it has to give me the total count and the percentage of each categories in the data.?

 

Any thoughts please?

 

Thanks 

Sriniv

 

 

14 REPLIES 14
TheOC
15 - Aurora
15 - Aurora

hi @sriniprad08 

I think i understand what you mean, to do this i would create a formula tool to calculate the total, and then divide the figure you want by this total figure. Can you upload a sample input and what you would like for an output, and i'd be happy to give this a go for you!


Bulien
sriniprad08
11 - Bolide

Hi @TheOC 

 

Thank you for helping out. Please find attach the sample data and the solution

sriniprad08_0-1603283726298.pngsriniprad08_1-1603283745917.png

 

RolandSchubert
16 - Nebula
16 - Nebula

Hi @sriniprad08 ,

 

there are different approaches to create this output, e.g. Summarize, Append Fields and Formula tools can be used.

I've attached a sample workflow. Let me know if it works for you.

 

Best,

 

Roland

TheOC
15 - Aurora
15 - Aurora

hi @sriniprad08 

I have created a workflow that makes this for you:

TheOC_0-1603284778165.png


Bare in mind the percentage is slightly inaccurate as its to 1 decimal place as you requested in your output. This can easy be changed in the formula tool however.

Please find attached the workflow, and let me know if i can help any further!


Bulien
sriniprad08
11 - Bolide

Hi @TheOC 

Thank you so much . Really appreciate your help. I have one question actually i am want the percentage of column A. But i can see in your workflow percentage is calculated for column C. Am i missing something?

 

Cheers,

Sriniv

sriniprad08
11 - Bolide

hi @RolandSchubert 

 

Thank you so much. its helpful and worked. However i have a question in case if i don't have the column C and i need to calculate the percentage of column A what changes i should have done to the workflow?

 

Cheers,

Sriniv

TheOC
15 - Aurora
15 - Aurora

@sriniprad08 

OOPS!

I had thought you wanted an average of Column C!

Easy fix:

TheOC_0-1603286794778.png


Attached a fixed solution!

Have a great day, and let me know if i can help any further!


Bulien
sriniprad08
11 - Bolide

Hi @TheOC 

 

Thank you so much. It works perfectly. However when i tried to run with my sample data its not. I don't have an amount column which we can sum . i have something like this . How can i modify the workflow?

 

Sample
AB 
Rs 
Gs 
Gt 
Rt 
Xt 
RolandSchubert
16 - Nebula
16 - Nebula

If I got you right, you want the share of "count"?  I've modified the workflow a bit.

Labels