I have created a derived view named 'dv_1' based on a base view named bv_1.
I need to create a new column named 'new_col' in the derived view 'db_1' using conditional logic.
The values in the new column 'new_col' depend on the values of two another columns that are found in the base view 'bv_1' named 'cd' and 'amt'. If the value in the 'cd' column equals 'c', then the values in the 'new_col' column should equal the value in the 'amt' column times -1. Otherwise, if the value in the 'cd' column equals 'd', then the value in the 'new_col' column should equal the value in the 'amt' column as is.
This is what I have entered in the 'Field expression:
case when bv_1.cd = 'c'
then dv_1.new_col = bv_1.amt * -1
else dv_1.new_col = bv_1.amt
However, I get the following error message:
Couldn't repari and continue parse(near character 110)
Any help would be greatly appreciated.