Compare content of few columns with string

Hi to all,

 

I have a number of columns, where values can be "yes"  or Null. I need to create column with "yes" value in case where one of values in this columns equal to "yes". I try to use "Java snippet" node with code:

String kompressiya;

kompressiya="no";

if (($Kompressiya_Kompressionnye_binty_levaya_noga$.equals("yes"))|
($Kompressiya_Kompressionnye_binty_pravaya_noga$.equals("yes"))|
($Kompressiya_Kompressionnyj_trikotazh_1_klassa_levaya_noga$.equals("yes"))|
($Kompressiya_Kompressionnyj_trikotazh_1_klassa_pravaya_noga$.equals("yes"))|
($Kompressiya_Kompressionnyj_trikotazh_2_klassa_levaya_noga$.equals("yes"))|
($Kompressiya_Kompressionnyj_trikotazh_2_klassa_pravaya_noga$.equals("yes"))) {
kompressiya="yes";}
return kompressiya;
 
I see only Null values in created column and I know that there ara rows with "yes" value in this columns.
Are there any errors? May be I can use another node?
Thank you,
Max. 

You can use the rule engine node to achieve this.

Simon.

However, this should also work in the Java Snippet node. If you use the #equals-method your pattern must exactly match, case-sensitive or leading or trailing spaces. Try $column$.trim().equalsIgnoreCase("yes") instead.

Thank you, Simon. It's work fine