Skip to main content
Participant
Mar 21, 2025 5:09 PM UTC
Answered

If statement in my Simplified field notation?

I finally got this to work and the result of this equation goes into a SubPayment field: 

 

WeeklySalary-EIPayment1*WeeklySalary1

 

However, when there is no amount in EIPayment1 I want the result to be zero in the SubPayment field.

 

Is there a way to do this? I am a brand spanking new user......

 

 

Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Mar 21, 2025 6:35 PM UTC

Use this as custom calculation script of SubPayment field:

var ws = Number(this.getField("WeeklySalary").valueAsString);
var ws1 = Number(this.getField("WeeklySalary1").valueAsString);
var ep = Number(this.getField("EIPayment1").valueAsString);

if(ep == 0)
 event.value = 0;
else
 event.value = ws-ep*ws1;

 

4 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
Mar 21, 2025 6:35 PM UTC

Use this as custom calculation script of SubPayment field:

var ws = Number(this.getField("WeeklySalary").valueAsString);
var ws1 = Number(this.getField("WeeklySalary1").valueAsString);
var ep = Number(this.getField("EIPayment1").valueAsString);

if(ep == 0)
 event.value = 0;
else
 event.value = ws-ep*ws1;

 

Translate
Participant
Mar 21, 2025 6:57 PM UTC

Thank you so much!!!!!!!

Translate
Bernd Alheit
Community Expert
Community Expert
Mar 21, 2025 5:22 PM UTC

If statement is there not possible.

Translate
Participant
Mar 21, 2025 6:18 PM UTC

how can I get the SubPayment field to show a zero or blank if there is no amount in the EIPayment1 field but do the cal I mentioned if there is

Translate