cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
614
Views
10
Helpful
5
Replies

UCCX Scripting - calculate percentage

ROB THORNTON
Level 1
Level 1

I'm running UCCX 10.6 Premium and trying to calculate a percentage between several variables. What step can I use to calculate this?

variable 1 = total calls that have come into CSQ#1

variable 2 = total calls that have come into CSQ#2

variable 3 is a parameter the client can add to specify the percentage of calls they wish to force into CSQ#2.

For example, if they want 33% of total calls entering the script to hit CSQ2. They enter 33% in a parameter variable and it calculates which CSQ to send the next call to.

I've tried various set steps to calculate csq2/csq1*100 and compare to variable 3 but no luck. Getting 0 as result every time so I think the set step is not an option.

Any help is appreciated.

1 Accepted Solution

Accepted Solutions

First you need to determine how many calls are already in queue for each CSQ, to do that you use "get reporting statistics" step and select "CSQ IPCC Express" object, and store either "total contacts" or "contacts waiting" for row identifier CSQ1, store it as CSQ1_count. Then do the same for CSQ2, this way you will have to counter variables CSQ1_count and CSQ2_count which you will use in your formula:

percent = CSQ2_count / (CSQ2_count + CSQ1_count) * 100

based on the value range of percent variable you will either send call to CSQ1 or CSQ2, i.e.

if percent <= var3 (var3 is the percentage parameter you want to control)

select resrouce CSQ2 (to sent calls to CSQ2 when percent is below the set threshold)

else

select resrouce CSQ1

View solution in original post

5 Replies 5

Chris Deren
Hall of Fame
Hall of Fame

Your formula would need to be CSQ1 / (CSQ1 + CSQ2) * 100 in order to get current percentage for CSQ1.

Is that a set step in the script?  Or what step and how would/should the actual line look that creates the new variable value? 


Thanks

First you need to determine how many calls are already in queue for each CSQ, to do that you use "get reporting statistics" step and select "CSQ IPCC Express" object, and store either "total contacts" or "contacts waiting" for row identifier CSQ1, store it as CSQ1_count. Then do the same for CSQ2, this way you will have to counter variables CSQ1_count and CSQ2_count which you will use in your formula:

percent = CSQ2_count / (CSQ2_count + CSQ1_count) * 100

based on the value range of percent variable you will either send call to CSQ1 or CSQ2, i.e.

if percent <= var3 (var3 is the percentage parameter you want to control)

select resrouce CSQ2 (to sent calls to CSQ2 when percent is below the set threshold)

else

select resrouce CSQ1

ROB THORNTON
Level 1
Level 1

The set step with Integer variable did not like the recommended formula. I changed the formula to

percent = (CSQ2_count * 100) / (CSQ2_count + CSQ1_count)

After that change, the percentage calculation is working great in the script. Thanks Chris.

Great, don't forget to mark the tread as answered and rate all useful posts!

Chris

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: