Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Section


Column
width600px


Panel
borderColor#333f48
bgColor#FFFFFF
titleColor#eeeeee
borderWidth1
titleBGColor#333f48
borderStylesolid
titleOn this page

Table of Contents
maxLevel1



Column




Features used to implement the example



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
pageMathematical and date-time expression calculator
labelsexample



Related Usage Examples

Content by Label
showSpacefalse
cqllabel = "example" and label = "custom-field"