Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table in which I want to replace certain field names subject to one condition. I have a table with three fields as below. I want to replace the field value in Identifier with Identifier 2 if the activity is Abnormal or Insufficient. The result table is found below in which I added the changes in bold font. Thank you in advance!
Initial table:
Identifier | Activity | Identifier 2 |
---|---|---|
123 | Normal | 321 |
1234 | Normal | 4321 |
12345 | Abnormal | 54321 |
123456 | Insufficient | 654321 |
Result table:
Identifier | Activity | Identifier 2 |
---|---|---|
123 | Normal | 321 |
1234 | Normal | 4321 |
54321 | Abnormal | 54321 |
654321 | Insufficient | 654321 |
Untested syntax.
LOAD
if(Activity = 'Abnormal' or Activity = 'Insufficient', [Identifier 2], Identifier) as Identifier,
....
FROM.
...
Untested syntax.
LOAD
if(Activity = 'Abnormal' or Activity = 'Insufficient', [Identifier 2], Identifier) as Identifier,
....
FROM.
...
Load
if(Activity='Abnormal' or Activity='Insufficient', Identifier2,Identifier) AS Identifier
Activity,
Identifier2
From Table1..
Yes, for Identifier we can make a condition instead of direct field.
if(Activity='Abnormal' or Activity ='Insufficient', Identifier2,Identifier) as Identifier,
This will check the Activity values if satisfies any one then identify2 value will be place for Identifier, if not Identifier value will be placed
Thanks everyone! Such a simple answer. Cheers!
How to write if want to rename with multiple field values?