Skip to main content
Known Participant
July 22, 2024
Answered

Calculate based on the value of another field and leave blank if other field is blank

  • July 22, 2024
  • 1 reply
  • 2438 views

I am looking for some help with form field calculations .

 1. I need to multiply "TGAI" * 0.03 , but if  "MedicalExpenses" is empty then leave return the value of "0". 

  •  this field, when calculated needs to return a negative value 

2. If  "HPW" AND "WPY" are blank then leave cell blank if "HPW" AND "WPY" have values then multiply "HW" * "HPY"

 

Thank you for any help you can provide. 

This topic has been closed for replies.
Correct answer PDF Automation Station

That worked , thank you so much , now i just have one more issue on this form and im done with it . 

 if you dont mind taking a look when you get a chance i would really appriciate it .

 

I have left notes on the form and included the entire worksheet this time for your reference . 

 

Again , thank you for your time 


if(!this.getField("GMI.0").value)
{event.value=25}
else
{event.value=this.getField("Calc_TotalMonthlyPayment").value-this.getField("Utilities").value}

1 reply

PDF Automation Station
Community Expert
Community Expert
July 22, 2024

1. 

if(!this.getField("MedicalExpense").value)

{event.value=0}

else

{event.value=this.getField("TGAI").value * .03 * -1}

2.

if(this.getField("HPW").value && this.getField("WPY").value)

{event.value=this.getField("HPW").value * this.getField("WPY").value}

else

{event.value=""}

CMunro87Author
Known Participant
July 23, 2024

Good morning and thank you for your response . the script provided for #1 does not work , but #2 does . 

PDF Automation Station
Community Expert
Community Expert
July 23, 2024

That worked , thank you so much , now i just have one more issue on this form and im done with it . 

 if you dont mind taking a look when you get a chance i would really appriciate it .

 

I have left notes on the form and included the entire worksheet this time for your reference . 

 

Again , thank you for your time 


if(!this.getField("GMI.0").value)
{event.value=25}
else
{event.value=this.getField("Calc_TotalMonthlyPayment").value-this.getField("Utilities").value}