Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If then else question

Status
Not open for further replies.

Thant

Technical User
Dec 31, 2007
103
US
I am using the following formula. When it runs in the master report most of the staff come out with the appropriate % of calls answered, but one employee in the last report came out with a 0% calls answered. After looking at the data the user did answer calls and it shows that in my non summarized fields.
Any ideas why this is? Did I make an error in my code? The only possibility I can think of is that this user did not answer any calls on one day therefore it throws the 0%. I did try to remove the =0 then 0 language from the formula and got a division by zero error

Any help is appreciated
Code:
if {tblIndvSympDataDaily.Calls Answered}= 0 then 0 else {tblIndvSympDataDaily.Calls Answered} % {tblIndvSympDataDaily.Calls Presented}
 
Hi,
What were the numbers for that person whose % showed as 0% ?

Are the 2 fields in the same section as the formula?


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I have columns of numbers for
Presented Answered % Answered DNCalls % DNCalls Total Calls

These are summarized columns placed in GH1 with no fields in the details section
The user in question has
70Present 63Answer 0%Answer 60DN 100%DN 123 total calls

They are not in the same column
The %DN calls code is
Code:
IF{tblIndvSympDataDaily.DN Calls}= 0 then 0 else {tblIndvSympDataDaily.DN Calls}/{@Total Calls}*100

I hope this makes some sense.
Thanks
 
I don't know if affects your problem, but i would add parenthseis' to change:
IF{tblIndvSympDataDaily.DN Calls}= 0 then 0 else {tblIndvSympDataDaily.DN Calls}/{@Total Calls}*100

into :
IF {tblIndvSympDataDaily.DN Calls}= 0 then 0 else ({tblIndvSympDataDaily.DN Calls}/{@Total Calls})*100


otherwise, i think you are multiplying {@Total Calls} by 100, not the results of {tblIndvSympDataDaily.DN Calls} divided by {@Total Calls}.
 
You need to take a look at the detail level data. Place the same formula in the unsuppressed detail section. Your formula if placed in the group footer is only testing the value of DN calls in the last detail record in the group--so if that is zero, then the value will be zero in the group footer.

-LB
 
I need the summaries to be in the percentage field not a detail field. I am giving this to the facilities manager on a weekly basis to get a snap shot of the previous week
Thanks again for all your help
 
I asked you to do that so that you could see what the problem is. I think you will find that the last record in the detail section is 0 for DN_calls. If so, you should change your formula to:

IF maximum({tblIndvSympDataDaily.DN Calls},{table.group1field})= 0 then
0 else
maximum({tblIndvSympDataDaily.DN Calls},{table.group1field})/{@Total Calls}*100

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top