10-16-2016 01:12 AM - edited 03-15-2019 06:24 AM
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.
Solved! Go to Solution.
10-17-2016 07:31 AM
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
10-17-2016 07:01 AM
Your formula would need to be CSQ1 / (CSQ1 + CSQ2) * 100 in order to get current percentage for CSQ1.
10-17-2016 07:15 AM
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
10-17-2016 07:31 AM
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
10-17-2016 01:30 PM
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.
10-17-2016 02:39 PM
Great, don't forget to mark the tread as answered and rate all useful posts!
Chris
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide