Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to make a if statement already in teh laoding script. Lets say i have a list of 5 clients. If client is 3 then Banana else just keep the original valuesof 1,2,4,5.
Client:
1
2
3 = Banana
4
5
Is this possible?
Lets assume the field this 1-5 is in is called "theField" (and A, B, C, E and F are random other fields from the same table):
LOAD
A,
B,
C,
if(theField = 3, 'Banana', theField) as aField
E,
F
from some source
;
try like this...
Load *,
if(Client='3', 'Banana', Client) as Client
From Source;
another one could be
Client:
load
Client as ClientOrig,
pick(wildMatch(Client, 3, '*'), 'Banana', Client) as Client
inline [
Client
1
2
3
33
4
5
];
For the best maintenance try this
Map_ClientName:
Mapping
LOAD * INLINE [
ID, Name
3, Banana
];
ClientTable:
Load
ApplyMap('Map_ClientName',Client) as Client
From Source.xls;
Applymap if no find ID in the Map_ClientName, put the original Client value.
So, if in the future you need other Name for your client, just add to the Map_ClientName.
![]()