Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
i have the table in which one filed values are like that
Server is the Fieldname and the values are
Server1-AP-DEV
Server2-AP-QA
Server3-AP-PRD
Server4-AP-DEV
Server5-AP-QA
Server2-AP-PRD
I need to be the fileds as like below
Server1-AP
Server2-AP
server3-AP
I applied the logic as like below for DEV
But i need for DEV,QA,PRD
Can any one please look into it
if(right(Server,4)='-DEV',Replace(Server,Right(Server,4),''),Server) as server1
To remove the last subfield regardless of the number of hyphens, use
=Replace(Field, '-' & SubField(Field, '-', -1), '')
(Replace Field with the correct fieldname)
=Left(Field, Index(Field, '-', -1)-1)
Or maybe something like
MAP:
MAPPING LOAD * INLINE [
F1,F2
-CONT,
-DEV,
-PRD,
-UAT,
];
LOAD *, Trim(MapSubString('MAP',Server)) as ServerNew INLINE [
Server
HSU-SGD-ICPM-MANAGement
HSU-SGD-ICPM-MANAGement-CONT
HSU-SGD-ICPM-MANAGement-DEV
HSU-SGD-ICPM-MANAGement-PRD
HKU-SPD-ICPMPI-MANAGement
HKU-SPD-ICPMPI-MANAGement-DEV
HKU-SPD-ICPMPI-MANAGement-UAT
];
But it's really depending on the possible values. Above will only work if you need to remove the mapping table values from your server field field values (and they can't appear as valid part of your server name that you want to keep).
Hi ,
Thnks for all replies,
I have applied this logic and its working fie for me now