I have a computed field that needs a "-" when denominator is 0 to replace divide by error. These two work fine:
COMPUTE trackobserv/D8.2% MISSING ON = IF cmp EQ 0 THEN MISSING ELSE cmptrk / cmp * 100; AS 'Percent,Tracked /,Observed'
COMPUTE observcomp/D8.2% MISSING ON = IF evals EQ 0 THEN MISSING ELSE cmp / evals * 100; AS 'Observed,Complaints,per Call'
However, this one does not work and displays ***** in the field.
COMPUTE avgcompl/D7.2% MISSING ON = IF calls EQ 0 THEN MISSING ELSE TOTCOMPL / calls * 100; AS 'Average,Complaints,per Call'
I can not figure out what's causing this...Any help would be appreciated.
Thanks,
JoeThis message has been edited. Last edited by: Kerry,
WebFocus 7.7.02 WinXP
October 26, 2012, 02:00 PM
rfbowley
Two observations
1) The ***** implies that the D7.2% format is not large enought to hold the result. What is the format of TOTCOMPL?
2) You might want to put parenthesis to control the sequence of mathematical operations. I Think what you really want is (TOTCOMPL / calls) * 100. This may also be a factor in item 1) above.
Robert F. Bowley Jr. Owner TaRa Solutions, LLC
In WebFOCUS since 2001
October 26, 2012, 03:54 PM
JOE
Thanks for the response. The thing I dont understand is shouldn't the value automatically display "-" once the calls field is 0? This should be true according to the IF statement and does work for the first two. Very odd? An example that I saw is a consultants calls field had 0 which should of spawn off the MISSING ON for the compute field..It didnt and created the ****** which is actually a divide by error.
Thanks,
Joe
WebFocus 7.7.02 WinXP
October 27, 2012, 01:18 PM
Danny-SRL
What is the format of "calls"? If it is a Dnn.n, then maybe its value is not a real 0 but a very small value. This would explain that MISSING was not returned and the **** are due to a very high number resulting of the division by a very small one.
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF