Table Editor/Field calculator/Condition field ?


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 ?


Olivier Leprêtre
December 12, 2015, 4:12 PM

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.

Olivier Leprêtre
December 12, 2015, 4:09 PM

So correct syntax is if(substr2( [NOM]; 0 ; 6 )="CAMERA" ;"CAMER" ;"" ) but it is test that is wrong

Olivier Leprêtre
December 12, 2015, 4:07 PM

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.

Sergei Leschinsky
December 12, 2015, 4:00 PM

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)?

Olivier Leprêtre
December 12, 2015, 3:54 PM

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...

Won't Do




Olivier Leprêtre



Affects versions