Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI i have a field Name PANACNO which his following values .
PANACNO
1:1-2-3-4-5
1:1-2-3-4-5-6
1:1-2-3/2:4-5-6
1:1-2-4-3
1:1-2/2:3-4
1:2-1
1:2-1-3
1:2-3
1:2-3-4
and my statement is following
if(len(PANACNO )>3,
mid(PANACNO ,
Index(PANACNO ,'-',-1) ),1)
which will give me value but with(-). i only want number.
I have attach the qvw
i have attach the qvw sample
please have a look
yes wanted to fix same expression , i have attach the qvw sample
i forgot to mention you that all the last number After last ( -)
so if
1:1-2-3/2:4-5-6 6
1:1-2-4-38 38
1:1-2/2:3-498 498
Subfield is the best option for this as suggested by roharoha
SubField(PANACNO,'-',-1)
T:load * inline [
PANACNO
1:1-2-3-4-5
1:1-2-3-4-5-6
1:1-2-3/2:4-5-6
1:1-2-4-3
1:1-2/2:3-4
1:2-1
1:2-1-3
1:2-3
1:2-3-4 ];
load SubField(PANACNO,'-',-1) as Output
Resident T;
drop table T;
SubField(PANACNO,'-',-1)