Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have field like
custname
berryNp
jhonNp
savinNP
cashRp
jasnRp
thsnKp
msnKp
-----------------------------------here every month customers will add this month 10 are there next month it will be 15
so I need separate field ending with all Np,Kp,Rp separate
how to achieve this?
try this:
load *,if(right(upper(custname),2)='NP',custname) as NP_custname ,if( right(upper(custname),2)='KP',custname) as KP_custname ,if( right(upper(custname),2)='RP',custname) as RP_custname Inline [
custname
berryNp
jhonNp
savinNP
cashRp
jasnRp
thsnKp
msnKp
];
EXIT SCRIPT ;
Load
custname,
If(SubStringCount(custname,'Np'),SubField(custname,'Np',1),If(SubStringCount(custname,'Rp'),SubField(custname,'Rp',1),If(SubStringCount(custname,'Kp'),SubField(custname,'Kp',1)))) As CustName1,
If(SubStringCount(custname,'Np'),'Np',If(SubStringCount(custname,'Rp'),'Rp',If(SubStringCount(custname,'Kp'),'Kp'))) As Suffix
Inline
[
custname
berryNp
jhonNp
savinNP
cashRp
jasnRp
thsnKp
msnKp
];
OR simply like this.
LOAD
UPPER(RIGHT(FIELD,2)) as RP_custname,
RP_NAME
FROM TABLE:
so that association also holds
Regards
CY