percentage in report (1 Viewer)

Ravi Kumar

Registered User.
Local time
Tomorrow, 04:00
Joined
Aug 22, 2019
Messages
162
dear all,

I have entered below expression to show percentage in my report , but unfortunately it is not displaying.
Code:
=[Sum Of Leave(Hrs)]/([Sum Of Leave(Hrs)]+[Sum Of LOP(Hrs)]+[Sum Of Absent(Hrs)]+[Sum Of OT(Hrs)])

can anyone help where i am wrong?
 

Attachments

  • percentage.jpg
    percentage.jpg
    107.3 KB · Views: 107

Gasman

Enthusiastic Amateur
Local time
Today, 22:30
Joined
Sep 21, 2011
Messages
14,048
I *think* if any of them are Null, then that will happen.
Surround each with the NZ() function and try that.

HTH
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:30
Joined
May 7, 2009
Messages
19,169
use the calculation on the Sum textboxes.
 

Ravi Kumar

Registered User.
Local time
Tomorrow, 04:00
Joined
Aug 22, 2019
Messages
162
use the calculation on the Sum textboxes.

Code:
=Nz("",[Sum Of Leave(Hrs)])/Nz("",([Sum Of Leave(Hrs)]+[Sum Of LOP(Hrs)]+[Sum Of Absent(Hrs)]+[Sum Of OT(Hrs)]))

Like this??(not working)
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:30
Joined
Sep 21, 2011
Messages
14,048
Now I do not know if Null is causing the problem, but you do not have the correct syntax for NZ() to start with.:confused:

Also if you are doing math on the controls, do you not think zero would be a better option rather than space?:(
 

Ravi Kumar

Registered User.
Local time
Tomorrow, 04:00
Joined
Aug 22, 2019
Messages
162
I replaced the empty cells with Zero & now it is working. Thank you for your tip.
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:30
Joined
Sep 21, 2011
Messages
14,048
That is what the NZ() function is meant to do?
 

Users who are viewing this thread

Top Bottom