by329704

Conditional replace function in Field Calculator

Discussion created by by329704 on Jun 20, 2012
Latest reply on Jun 20, 2012 by dkwiens
I'm trying to write an expression that will allow me to change the text of a string field based on it's values.

Here's what I have so far.

----

Dim output as String

IF [DUPLICATE] = "0"
THEN
output = replace( [DUPLICATE], "0", "CATEGORY 1")
end if

IF [DUPLICATE] = "1"
THEN
output = replace( [DUPLICATE], "1", "CATEGORY 2")
end if

IF [DUPLICATE] = "2"
THEN
output = replace( [DUPLICATE], "2", "CATEGORY 3")
end
----

Any help would be appreciated.

Outcomes