Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to map values with squarebrackets into values without squarebrackets while loading???
the below coding doesnot work..
map1:
mapping load * Inline
[
x,y
"187[32]",'187'
];
can anyone help!!!
Field1 also has values without square brackets...those values are not listed..
Eg:
1111[nb 2]
2222[4]
3333[4]
4444
5555
On using Left( ), Output is
1111
2222
3333
4444 and 5555 are not listed....
Hi,
Yes, because there is no index number, but a conditional should work around that
Directory;
Data:
LOAD Left(Field1, If(Index(Field1, '[') -1 <= 0, Len(Field1), Index(Field1, '[') -1)) AS Field1
FROM
test.txt
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
So you keep using Left() but when there is no bracket, then you take all characters from value, otherwise only until the bracket.
Hope that helps.
BI Consultant
Thanks Dude...