I'm trying to add informations in one column by using tJavaRow module and using conditional expression. The target here is simple. If "Fonction_libelle" column containt "DIRECTEUR" information, add in "Directeur_Oui_Non" column "Oui" else add "Non". I tried this :
if (input_row.Fonction_libelle == "DIRECTEUR") { output_row.Directeur_Oui_Non = "Oui";} else {output_row.Directeur_Oui_Non = "Non";}
The output of this is i've got "Non" everywhere but there are some "DIRECTEUR" in "Fonction_libelle" column. Of course there is something wrong but i'm not able to see what...
Any help would be very appreciated !
Try with .equals() instead of ==
if ("DIRECTEUR".equals(input_row.Fonction_libelle)) {
output_row.Directeur_Oui_Non = "Oui";}
else {output_row.Directeur_Oui_Non = "Non";}
"==" is not recommended to compare strings