Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I was trying to execute below code.. and I think I should get only one row... however I am getting two..
a:
Load *
inline
[
field
Great_CAll
];
b:
load field,
SubField(field,'_CAll') as client
Resident a;
drop table a;
EXIT Script;
You will get 2 because you have no specified the third argument. May be try this:
a:
Load *
inline
[
field
Great_CAll
];
b:
load field,
SubField(field,'_CAll', 1) as client
Resident a;
drop table a;
EXIT Script;
You will get 2 because you have no specified the third argument. May be try this:
a:
Load *
inline
[
field
Great_CAll
];
b:
load field,
SubField(field,'_CAll', 1) as client
Resident a;
drop table a;
EXIT Script;
Hi Sunny,
I was 100% sure that you will give me answer for this.. thanks.. could you elaborate it.. I still don't understand, why it is giving an additional row?
Hi Kamal,
Try This
a:
Load *
inline
[
field
Great_CAll
];
b:
load field,
SubField(field,'_CAll','_') as client
Resident a;
drop table a;
EXIT Script;
Without the third argument SubField behaves like a loop. Since there is only one _CAll it will loop twice. If there were 2, then it would have looped thrice. So general rule here is if you have n _CAll, it will loop n+1 times. In your case you might think that there is nothing after _CAll, but it will still create an extra row with empty cell. Does that make sense?
Check this link,
Link:http://webofwork.com/splitting-a-string-into-seperate-fields-using-subfield/
absolutely.. learnt new thing..