Calculate function allows to use "if" to add condition. But it doesn't seem to have a place to fill condition before field future content.
If ou insert "if(substr2( NOM ; 1 ; 6 )='CAMERA' ;'CAMERA' ;'' )" with quotes, if will obviously fill field with this value, but if you omit quotes, syntax will also be bad.
A "condition field" needs to be added to field calculator ?
ok, so valid expression should be if(substr2( [NOM]; 1 ; 6 )="CAMERA" ;"CAMERA" ;"" )
In my case, all results are always set to false (empty) even if some NOM field contains CAMERA_01, CAMERA_02...
I've just checked this expression on other table and it worked. Are you sure that you are choosing the start index right (they are 0 based)?
Yes, I checked 0,6, even 0 5 to see if it was char 0 to char 5 but checked with "test" and with test, all results are empty.
So correct syntax is if(substr2( [NOM]; 0 ; 6 )="CAMERA" ;"CAMER" ;"" ) but it is test that is wrong
Ok I understood, results are empty because I see only a few records with test, so it must be the ones for which condition is not set.
You can close this one.