Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All, I have data as follows:
Date | Process | Emp name | Manager Name |
---|---|---|---|
08-02-16 | AA | A | P |
09-02-2016 | AA | B | Q |
10-02-2016 | BB | C | R |
10-02-2016 | CC | D | P |
07-02-2016 | BB | E | T |
Now, I have two same process (AA) under two different managers (P and Q), So, I want to change one of the process to ZZ(say Process AA under P to ZZ) and Process CC under P should not change.
I want do this while loading the data.
Thanks in advance.
If([Manager Name] = 'P' and Process = 'AA','ZZ',Process) as Process,
Hi,
As Mike suggested will fix it, but it if there is a lot of changes a mapping table may be better.
Change
Mapping LOAD * INLINE [
ManagerProcess , Process
PAA, ZZ
];
Load
Date,
ApplyMap('Change',[Manager name]&Process,Process) AS Process
[Emp name],
[Manager name],
FROM 'YOUR TABLE';
if you have a number of changes you can do this with out writing lots of if statements.
Mark
HI Priyanka,
Try this
Test:
LOAD * INLINE [
Date,Process, Empname, ManagerName
08-02-16, AA, A, P
09-02-2016, AA, B, Q
10-02-2016, BB, C, R
10-02-2016, CC, D, P
07-02-2016, BB, E, T
];
New_Process:
LOAD * INLINE [
Process_T, Manager, NewProcess
AA, P, ZZ
];
Map_Name:
Mapping
load
Process_T &'-'&Manager as Key_Map,
NewProcess
resident New_Process;
Test1:
load
*,
applymap('Map_Name',Process &'-'&ManagerName,Process) as NewProcess
resident Test;
drop table Test;
-Sathish