Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Check out our latest virtual session where BARC Fellow, Doug Laney, highlighted the opportunities data monetization can offer enterprises. Watch here.
cancel
Showing results for 
Search instead for 
Did you mean: 
everest226
Creator III
Creator III

trim statement

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.

stalwar1

17 Replies
everest226
Creator III
Creator III
Author

I have attach the qvw

everest226
Creator III
Creator III
Author

i have attach the qvw sample

Anonymous
Not applicable

please have a look

everest226
Creator III
Creator III
Author

yes wanted to fix same expression , i have attach the qvw sample

everest226
Creator III
Creator III
Author

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

Digvijay_Singh

Subfield is the best option for this as suggested by roharoha

SubField(PANACNO,'-',-1)

shiveshsingh
Master
Master

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;

shiveshsingh
Master
Master

SubField(PANACNO,'-',-1)