Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Dynamically allocating Percentage in Script Editor

Does anyone know how to allocate a Percentage value dynamically? This is to achieve percentage splits using an external datbase (Db Lookup) and specifying the percentages in that database which would control the percentage split in Script Editor. The Distribute node is not applicable as I am trying to send a percentage to an external Label and the others to a Requalify Node.

6 REPLIES
Silver

Re: Dynamically allocating Percentage in Script Editor

Can you be specific with your requirement. I don't understand what you mean by "percentage in script editor"

New Member

Re: Dynamically allocating Percentage in Script Editor

By percentage in Script Editor - I mean the Percentage Allocation node in Script Editor for ICM.

Thanks

Ali

New Member

Re: Dynamically allocating Percentage in Script Editor

Ali,

You would need to define a global variable, initialize it to 0 (administrative script) and then make the script to add 1 to the varialbe each time a call is received. Let say i is this variable.

You can use this i to check percentages inside if clauses. For example mod(i/2)==0 is true 50% of the times, mod(i/100)==0 is 1% and so on and so forth.

Regards,

Alfonso

New Member

Re: Dynamically allocating Percentage in Script Editor

Alfonso

Thanks YES I can see that this will work. I will check it out and try to implement it - the problem is that my dB Lookup is based on Call Type and I will have a different % for each call type (about 500 call types total).

I will test how best it can be achieved before offering the solution to the customer.

Thanks again.

Ali

New Member

Re: Dynamically allocating Percentage in Script Editor

OK, then what you can do is to generate a random number between 0 and 1 using r=random() and check if r

New Member

Re: Dynamically allocating Percentage in Script Editor

Hi,

I know is an old conversation but did it work? how can you set the value in the %allocation node if just recevied numbers as values, can put a variable name....

545
Views
5
Helpful
6
Replies