Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I've ID and against that there is one flag which has 1 & 2 values. I want 2nd value for 1st flag and 1st value for 2nd flag.
Is there any simple code for this.
This is my requirement:
For reference, below is the Inline Code:
LOAD * INLINE [
ID, Group_Name, Flag_New, Amount
"Test_Code1", AAA, 1, 40000
"Test_Code1", BBB, 2, 55000
"Test_Code2", CCC, 1, 88000
"Test_Code2", DDD, 2, 91000
"Test_Code3", EEE, 1, 62000
"Test_Code3", FFF, 2, 20000
];
Regards,
Eric
@erric3210 One Option :
Data:
LOAD * INLINE [
ID, Group_Name, Flag_New, Amount
"Test_Code1", AAA, 1, 40000
"Test_Code1", BBB, 2, 55000
"Test_Code2", CCC, 1, 88000
"Test_Code2", DDD, 2, 91000
"Test_Code3", EEE, 1, 62000
"Test_Code3", FFF, 2, 20000
];
left join
load pick(Match(Flag_New,'1','2'),'2','1') as Flag_New,ID,Amount as Desired_output resident Data;
output:
@erric3210 One Option :
Data:
LOAD * INLINE [
ID, Group_Name, Flag_New, Amount
"Test_Code1", AAA, 1, 40000
"Test_Code1", BBB, 2, 55000
"Test_Code2", CCC, 1, 88000
"Test_Code2", DDD, 2, 91000
"Test_Code3", EEE, 1, 62000
"Test_Code3", FFF, 2, 20000
];
left join
load pick(Match(Flag_New,'1','2'),'2','1') as Flag_New,ID,Amount as Desired_output resident Data;
output:
Hi Taoufiq ZARRA,
Thanks for the Solution. It worked.
Regards,
Eric