Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Quick question, I have a field within a table with a list of values as such:
500 100
600 200
800 100
20 30
10000 20000
50000 60000
2 3
I need to use a string function to only give me the numbers on the right of the space ' ' so that I end up with the following:
100
200
100
30
20000
60000
3
Can anyone help?
Thanks,
Nikki
Hi
Try like this
=SubField(Fieldname,' ',-1)
Hi
Try like this
=SubField(Fieldname,' ',-1)
You can use subfield to get the required number.
Subfield is looking for the second value found and delimiter is a space:
Test:
LOAD * INLINE [
Numbers,
500 100,
600 200,
800 100,
20 30,
10000 20000,
50000 60000,
2 3
];
[Final]:
LOAD SubField(Numbers,' ',2) as Number
RESIDENT Test;
DROP Table Test;
subfield(yourfield,' ',2)
Use Subfield() function, like:
Load
SubField(YourField, ' ', 2) as CorrectedValue
from <>;
Hi Nikki,
Somthign likethat would do.
=mid('500 100',index('500 100',' '))
IT returns 100 for me
thanks,
Rajesh Vaswani
Hi,
Try below in Script Load:
=Right( YourFieldName, index( YourFieldName,' ') -1 ) as GiveFieldName
Hope to help.
Khan
Hai Try it....
Table1:
LOAD * INLINE [
F1
12 313
123 33
23232 33
233 33
];
Table2:
load
subfield(F1, Chr(32) ,1) as F1
Resident Tab1;
Drop Table Table1;
Hope this helpful..
Hi. Nikki.
TABLE_1;
LOAD * INLINE [
F1
500 100
600 200
800 100
20 30
10000 20000
50000 60000
2 3
];
RESULT:
LOAD
MID(F1, index(F1,' ',1),Len(F1)) AS FIELD
RESIDENT TABLE_1;
DROP TABLE TABLE_1;