Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field called work_type. Each field value looks something like this
A.Work Central
B.Work South
I want to suppress the first character (the letter, in this case A B etc) and the period. So I want to show
Work Central
Work South
In my code I used this
left(work_type,3) as [Work Category]
It produced A.W or B.W
Hi,
one solution:
LOAD Right(work_type, Len(work_type)-2) as work_type
Inline [
work_type
A.Work Central
B.Work South
];
hope this helps
regards
Marco
Hi,
one solution:
LOAD Right(work_type, Len(work_type)-2) as work_type
Inline [
work_type
A.Work Central
B.Work South
];
hope this helps
regards
Marco
or creating your desired "Work Category" field:
LOAD *, Right(work_type, Len(work_type)-2) as [Work Category]
Inline [
work_type
A.Work Central
B.Work South
];
hope this helps
regards
Marco
Pefect. Thank you. I come from a SAS background in which syntax is slightly different.
Just a thought...if it were possible that the first character, A or B, could be AA or AB, a better solution would be like below...
Load SubField(work_type,'.',2) as work_type; // preceeding load to remove the character and period
Load * Inline [work_type
A.Work Central
B.Work South
AA.Work Europe
AB.Work South America
];
This will return the field name after the first '.' (period) regardles of the length of the preceeding character(s). In this case;
Work Central
Work South
Work Europe
Work South America
HTH,
John