Hi there I am trying to replace some values of a column (A) using another column (B) based a reference column (REF C). I was tying using java, but I have an error.
This what I want.
ROW ID
COLUMN A
COLUMN B
REF C
NEW COLUMN A
1
OLD VALUE
NEW VALUE
REPLACE
NEW VALUE
2
SAME VALUE
SAME VALUE
NOT REPLACE
SAME VALUE
3
OLD VALUE
NEW VALUE
REPLACE
NEW VALUE
4
SAME VALUE
SAME VALUE
NOT REPLACE
SAME VALUE
5
OLD VALUE
NEW VALUE
REPLACE
NEW VALUE
The code is the following:
if (c_REFC.equals("REPLACE")) {
c_COLUMNA=c_COLUMNA.replace(c_COLUMNB);
} else {
c_COLUMNA=c_COLUMNA;
}
I know that the above table is asking to add a new column, but I need is to replace some values.
PS: in this case the order of rules does not matter, you could add the new rule before the other one. In case you prefer the results to be in NEW COLUMN A, uncheck the replace column option.