Skip to main content
hblood
Participant
October 31, 2019
해결됨

Calculation: If this and this are true, then 'YES'; else 'NO'

  • October 31, 2019
  • 2 답변들
  • 733 조회

I would like to create a YES or NO answer in a text field using 2 conditions.

 

if 'TotalFamSize' = 1

and 

the value of 'TotalFam6MoInc' <= the value of 'Six-Month Inc1'

then

'Level1Met' value is "YES"

else value is "NO"

 

Thanks for any help you can share.

 

 

 

이 주제는 답변이 닫혔습니다.
최고의 답변: try67

As the custom calculation script of Level1Met enter this code:

 

 

if (this.getField("TotalFamSize").valueAsString=="1" && (Number(this.getField("TotalFam6MoInc").valueAsString) <= Number(this.getField("Six-Month Inc1").valueAsString))) 
	event.value = "YES";
else event.value = "NO";

 

2 답변

try67
Community Expert
try67Community Expert답변
Community Expert
October 31, 2019

As the custom calculation script of Level1Met enter this code:

 

 

if (this.getField("TotalFamSize").valueAsString=="1" && (Number(this.getField("TotalFam6MoInc").valueAsString) <= Number(this.getField("Six-Month Inc1").valueAsString))) 
	event.value = "YES";
else event.value = "NO";

 

hblood
hblood작성자
Participant
October 31, 2019

This worked perfectly.  Thank you!

I can now use this for the additional 9 levels by changing the .valueAsString and the field references.