Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the below expression which calculates the percentage of calls where the withinfix field is No by doing a count of the field callref.
=num(count({$<[withinfix]={No}>} withinfix) / count(callref), '##.00%')
However I want to filter it futher by picking up the above only if the location field = 'CLO'. How would I do this?
Regards,
Jon
Hi Jonathan, Please try like below:
NUM( count({$<withinfix={No}, location={'CLO'}>} withinfix) / count({<location={'CLO'}>}callref) , '##0.00%' )
In the above expression, the Num function should be return the % Value. If not please calculate the % by multiplying with 100.
NUM( count({$<withinfix={No}, location={'CLO'}>} withinfix) / count({<location={'CLO'}>}callref) , '##0.0000' ) *100 & '%'
Jon, try this:
=num(count({$<[withinfix]={No}, location={'CLO'}>} withinfix) / count(callref), '##.00%')
Hi,
I forgot to mention that my callref field pulls out all the calls references in the database, so I have to run the below so my callref field only pulls out a location of CLO.
num(count({$<[withinfix]={No}, location={'CLO'}>} withinfix) / count(if(location = 'CLO', callref)))
If I run the above script, it pull through the following: 0.13337, which is correct but how would I display this as a percentage because if I add in the '##.00%', it pull up all my callref which is 68000 instead of my CLO call ref which is 1522.
First, it is better to be consistent - if you use set analysis in the numerator, use it in denominator as well.
count({$<withinfix={No}, location={'CLO'}>} withinfix) / count({<location={'CLO'}>}callref)
Or use "if" in both:
count(if(withinfix='No' and location='CLO', withinfix)) / count(if(location='CLO', callref))
Next, about formatting.
If you use this expression within a chart, it is better to define format in the chart properties, tab "Number". No need to define format in expression itself.
If your expression is outside of the chart, your formatting should work. Check the syntax, especially the parenthesis.
Hi Michael,
Thanks for the response back, I am using the expression in a text object.
Hi Jonathan, Please try like below:
NUM( count({$<withinfix={No}, location={'CLO'}>} withinfix) / count({<location={'CLO'}>}callref) , '##0.00%' )
In the above expression, the Num function should be return the % Value. If not please calculate the % by multiplying with 100.
NUM( count({$<withinfix={No}, location={'CLO'}>} withinfix) / count({<location={'CLO'}>}callref) , '##0.0000' ) *100 & '%'
Thank you to both of you for your help.