Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
As per the loaded data, I need 1st three codes (MC, M4,M3) to be renamed as MO & other codes as NM. How this is done using said functions
Thanks
Neville
You did not close the bracket for IF try below:
LOAD *,IF(MATCH(ACCOUNT_CODE,'61250','61150','61350'), 'MO',IF(MATCH(ACCOUNT_CODE,'61110','61210','61160','61230','61150'),'NM')) AS NEW_CODE INLINE [
attached doc
Try this:
LOAD *, IF(Match(PRD_CODE, 'MC','M3','M4'), 'MO','NM') AS NewCode INLINE [
PRD_CODE, ACCOUNT_CODE,VALUE
MC, 61250,50000
M3, 61150,25000
M4, 61350,15000
FR, 61110,12000
TC, 61210,10000
MS, 61160,4500
HH, 61230,5000
PP, 61150,50000
];
Hi Vishwarath,
Thanks for the reply. this is ok, If I have more codes for other variables which I have included here (KK,UU) when I need to specificaly mention that code 61250,61150,61350 to be named as MO & need to mention the other codes as NM which I wrote here has a syntax error.Can you please advice me on this. because if I merely say these three codes as MO & all other codes as NM ,all balance codes including KK & UU too will be named as NM. I need not KK & UU to be named NM.
LOAD *,IF(MATCH(ACCOUNT_CODE,'61250','61150','61350'), 'MO',IF(MATCH(ACCOUNT_CODE,'61110','61210','61160','61230','61150'),'NM') AS NEW_CODE INLINE [
PRD_CODE, ACCOUNT_CODE,VALUE
MC, 61250,50000
M3, 61150,25000
M4, 61350,15000
FR, 61110,12000
TC, 61210,10000
MS, 61160,4500
HH, 61230,5000
PP, 61150,50000
KK,51111,2000
UU,51112,3000
];
You did not close the bracket for IF try below:
LOAD *,IF(MATCH(ACCOUNT_CODE,'61250','61150','61350'), 'MO',IF(MATCH(ACCOUNT_CODE,'61110','61210','61160','61230','61150'),'NM')) AS NEW_CODE INLINE [
Thanks Viswarath
It is pretty alright!
Neville