Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

wildmatch

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?

3 Replies
chinnuchinni
Creator III
Creator III

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 ;

sasiparupudi1
Master III
Master III

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

];

ychaitanya
Creator III
Creator III

OR simply like this.

LOAD

UPPER(RIGHT(FIELD,2)) as RP_custname,

RP_NAME

FROM TABLE:


so that association also holds

Regards

CY