Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team
can you please help me with the below scenario
i have field name "mat" in my table which has data like is shown below
Mat:
96-HF469A1-SRVC
UW-HA546A1-SRVC
SI-815100-B21-JK03
SI-865408-B21-JK03
TN-P00930-B21-JK03
UW-HA454A1-021-JK03
output should be like below
output:
HF469A1
HA546A1
815100-B21
865408-B21
P00930-B21
HA454A1-021
Thanks and regards
siva
this should do what you need.
RAW:
Load if(SubStringCount(mat, '-') >=3,
subfield(mat, '-', 2) & '-' & subfield(mat, '-', 3),
subfield(mat, '-', 2)) as mat
;
LOAD * INLINE [
mat
96-HF469A1-SRVC
UW-HA546A1-SRVC
SI-815100-B21-JK03
SI-865408-B21-JK03
TN-P00930-B21-JK03
UW-HA454A1-021-JK03
];
this should do what you need.
RAW:
Load if(SubStringCount(mat, '-') >=3,
subfield(mat, '-', 2) & '-' & subfield(mat, '-', 3),
subfield(mat, '-', 2)) as mat
;
LOAD * INLINE [
mat
96-HF469A1-SRVC
UW-HA546A1-SRVC
SI-815100-B21-JK03
SI-865408-B21-JK03
TN-P00930-B21-JK03
UW-HA454A1-021-JK03
];
Please do call this writing to the module
function output(val)
dim p1,p2
p1=instr(val,"-")
p2=instrrev(val,"-")
output=Mid(val,p1+1,p2-(p1+1))
end function