[NSFW] Comparing two fields (if not empty)
-
Hi CodePeople!
I have two currency fields (fieldname1 and fieldname2) and a calculated field (fieldname3). I want to compare the entries of the currency fields (only if these are filled):
fieldname3 => IF(fieldname1|r === fieldname2|r),1,0)
This works nice, however, when I want to put it into the following function, empty currency fields are treated as “0” and therefore result in 1:(function() {
if (fieldname1 !== “” && fieldname2 !== “” && fieldname1 === fieldname2) {
return 1;
} else {
return 0;
}
})();What can I do?
Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[NSFW] Comparing two fields (if not empty)’ is closed to new replies.