Copy link to clipboard
Copied
This one is a little beyond me so I'm hoping someone can help -
I'm working with 5 fields, I'll label them "fieldA"-"fieldE" for simplicity sake.
Here is what I'm after: fieldD = fieldB, unless: 1) fieldE is greater than 50,000 and 2) fieldB is null, then fieldD = fieldC.
Field D is where the calculation would be.
Example 1:
fieldA: $100,000
fieldB: null (not sure how to express this in the field itself, does null or N/A work, or leaving it blank wihtout it reading as 0?)
fieldC: $60
fieldD: (result should be $60)
fieldE: $150,000
Example 2:
fieldA: $95,000
fieldB: $20
fieldC: (this will default as a 0.00)
fieldD: (result should be $20)
fieldE: $90,000
Thanks all of you wonderful people!
Copy link to clipboard
Copied
Null, an empty string and zero are not the same things, so it's important to know what you're dealing with.
Assuming it's a blank field, you can use this code as the custom calculation script of fieldD:
var fieldB = this.getField("fieldB").valueAsString;
var fieldC = this.getField("fieldC").valueAsString;
var fieldE = this.getField("fieldE").valueAsString;
if (Number(fieldE)>50000 && fieldB=="") event.value = fieldC;
else event.value = fieldB;
Copy link to clipboard
Copied
Null, an empty string and zero are not the same things, so it's important to know what you're dealing with.
Assuming it's a blank field, you can use this code as the custom calculation script of fieldD:
var fieldB = this.getField("fieldB").valueAsString;
var fieldC = this.getField("fieldC").valueAsString;
var fieldE = this.getField("fieldE").valueAsString;
if (Number(fieldE)>50000 && fieldB=="") event.value = fieldC;
else event.value = fieldB;
Copy link to clipboard
Copied
PS. fieldA doesn't seem to have a role in this formula...