percentage in report (1 Viewer)

Ravi Kumar

Registered User.
Local time
Today, 18:39
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: 32

Gasman

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

HTH
 

arnelgp

error reading drive A:
Local time
Today, 21:09
Joined
May 7, 2009
Messages
11,514
use the calculation on the Sum textboxes.
 

Ravi Kumar

Registered User.
Local time
Today, 18:39
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, 13:09
Joined
Sep 21, 2011
Messages
7,734
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
Today, 18:39
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, 13:09
Joined
Sep 21, 2011
Messages
7,734
That is what the NZ() function is meant to do?
 

Users who are viewing this thread

Top Bottom