Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Calculating percentage in alteryx

suds144
8 - Asteroid

Hello everyone,

 

I've been trying to calculate the % of attendance to an event by society. Ideally I would like to have a column in alteryx that showcases the % of attendance to an event (taking into account the total number of students in the society and the total number of events attended). 

Ideal output

suds144_0-1644240094411.png

 


Thank you

 

11 REPLIES 11
binuacs
21 - Polaris

@suds144 

binuacs_0-1644241012833.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @suds144 

 

Just adding to @binuacs approach which meets the requirement. Note that when you display with % sign it will turn to string. You show it without percentage so that it is treated as number.

 

atcodedog05_0-1644241838166.png

 

Hope this helps : )

suds144
8 - Asteroid

Thank you! I just tried this but got an error "Tried to apply numeric operator to string value". How do I rectify this?

atcodedog05
22 - Nova
22 - Nova

Hi @suds144 

 

Use a select tool and convert datatype to double.

 

Workflow:

atcodedog05_0-1644243220527.png

 

Hope this helps : )

suds144
8 - Asteroid

This helps a lot! Thank you!

In certain cases the total number of events attended is higher than the number of students in the society. This is giving a very high %.

For example

suds144_0-1644243613487.png

There isn't anything I can do about this. It's just skewing the data.

 

atcodedog05
22 - Nova
22 - Nova

Hi @suds144 

 

If attending people is more than total should we round it off to 100 or what should we do?

 

 

suds144
8 - Asteroid

I think it's more what should we do to? I welcome any thoughts and opinions.

suds144
8 - Asteroid

Maybe rounding to 100 would work?

atcodedog05
22 - Nova
22 - Nova

Hi @suds144 

 

What you should do is totally dependent on the business requirement. If you want to round it 100. Here is how you can do.

 

Workflow:

atcodedog05_0-1644245005259.png

 

Hope this helps : )

 

Labels