Jump to content
  • 0

Calculate a percentage between two fields


Hiperf

Question

I am not sure why I keep getting an Error in Formula when I try to do this:

Occupied Units
[@calcfield:1] is [@field:tblBuilding_BldgRSPUnits]+[@field:tblBuilding_BldgMauiUnits]  These are both Number Values

[tblBuilding_BldgTotalUnits] This is a Number Value

I need to find the percentage of Occupied Units out of the Total Units

I tried
(([@calcfield:1] /[tblBuilding_BldgTotalUnits])/100)

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
2 hours ago, Hiperf said:

I am not sure why I keep getting an Error in Formula when I try to do this:

Occupied Units
[@calcfield:1] is [@field:tblBuilding_BldgRSPUnits]+[@field:tblBuilding_BldgMauiUnits]  These are both Number Values

[tblBuilding_BldgTotalUnits] This is a Number Value

I need to find the percentage of Occupied Units out of the Total Units

I tried
(([@calcfield:1] /[tblBuilding_BldgTotalUnits])/100)

Hi @Hiperf,

There could be at least one record on the field [tblBuilding_BldgTotalUnits] that is blank. Also, it should be [field:tblBuilding_BldgTotalUnits].

You may try either of these:

(([@calcfield:1] / (CASE WHEN [field:tblBuilding_BldgTotalUnits] = 0 THEN 1 ELSE [field:tblBuilding_BldgTotalUnits] END))/100)

or

(([@calcfield:1] /ISNULL([field:tblBuilding_BldgTotalUnits], 1))/100)

 

For reference, kindly check this article: https://howto.caspio.com/function-reference/

 

:) 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...