Skip to main content
Question

How do I get a Formula Numeric filed to display null not 0?

  • Nov 17, 2019 9:36 PM UTC
  • 0 replies
  • 138 views

I need a formula numeric field (called No of Vehicles) to return null and not 0 when a condition is met: 

If ([No of Techs/Vehicle] = null, null)

The full formula for this field (No of Vehicles) is:

If ([No of Techs/Vehicle] = null, null,
If ([Vehicle per technician] = "Yes", ToNumber([No of Technicians]),
If ([Vehicle per crew] = "Yes", ToNumber([No of Crew])
))

Note: 
No of Techs/Vehicle is a formula numeric field
Vehicle per technician is a text - multiple choice field
Vehicle per crew
is a text - multiple choice field

Thanks in advance for any help!

------------------------------
Andrea Pahor
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+19
  • Qrew Champion
  • Nov 17, 2019 10:11 PM UTC
Andrea,

Try this:

// Calculate the Vehicles Per Tech
var number VehiclesPerTech =If ([Vehicle per technician] = "Yes", ToNumber([No of Technicians]);
// Calculate the Vehicles Per Crew
var number VehiclesPerCrew = If ([Vehicle per crew] = "Yes", ToNumber([No of Crew]);
// Calculate the Techs Per Vehicle, Account for the case where the denominator is zero
var number TechPerVehicle =  if( $VehiclesPerCrew=0, 0, $VehiclesPerTech/$VehiclesPerCrew);
// Control the UI to show a Null Value of the answer is Zero
if ( $TechPerVehicle=0,null, $TechPerVehicle)

------------------------------
Don Larson
Paasporter
Westlake OH
------------------------------