Page History
Section | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Example: Increment a field or set to 1 if it's not set
I want to increment a number field, but the issue I have with the function Mathematical and date-time expression calculator in that when the field has a number it increments correctly, but for the very first increment the Number field is empty, so the function requests that it be initialised and fails.
I then tried the Copy a parsed text to a field to see if this expression would work: %{11002} = Null ? 1 : (sum({11002},1))
You should use Mathematical and date-time expression calculator with the following expression:
{11002} = null ? 1 : {11002} + 1
Just for fun, this is an alternative expression:
{11002} = null ? 1 : sum(toNumberList(%{11002} + ", 1", ","))
Another alternative expression
sum([{11002}]) + 1
Other examples of that function
Incoming Links | ||||
---|---|---|---|---|
| ||||
Related Usage Examples
Content by Label | ||||
---|---|---|---|---|
|