Siebel Developer's Reference > Operators and Expressions > Expressions >

Using the IIf Function


This topic describes using the IIf Function with string concatenation. The following example assigns an expression to the Calculated Value property:

[Field]
Name = "Full Name"
TextLen = 102       // Last Name + First Name + 2
Calculated = "TRUE"
CalculatedValue = "[Last Name] + "," + [First Name]"

Double quotation marks must enclose the "," string constant because double quotation marks enclose the entire value. If the Last Name field contains NULL, and if the First Name contains Bob, then the Full Name field contains the following value:

, Bob

Consider the following example:

CalculatedValue = "[Last Name] + IIf ([Last Name] IS NULL,
"", ",") + [First Name]"

If the Last Name field contains NULL, and if the First Name field contains Bob, then the result contains the following value:

Bob

The CalculatedValue expression must reside on one line.

Siebel Developer's Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.