I have a question about "default value" based on expression.
For exeaple, I have a layer in a GPKG, with 3 attributes: "Number" / "Letter" / "Roman".
For my attribute "Number", I have a value from a list with 1, 2 and 3. For the attribute "Letter", this attribute is not editable. In "default value", I have this expression:
IF("Number"=1, 'one', IF("Number"=2, 'two','three'))
This step work fine, and if I change the value "Number", the "Letter" is updated... Perfect!
Now, if I do the same for the attribute "Roman", but based on "Letter", calculated previously:
IF("Letter" like 'one', 'I', IF("Letter" like 'two', 'II','III'))
But it doesn't work. The attribute isn't calculated, and isn't updated when a change occurs.
=
is for comparing numerical values. For strings you have to useLIKE
.