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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
skr002244
Contributor III
Contributor III

How to extract a part of a string and display it on the listbox?

Hello, I want to extract a particular portion of a string.So,can anyone tell me the code for it ?

Example-123TY-P1-00TY. In this i want only P1 to be displayed on the listbox .

13 Replies
arulsettu
Master III
Master III

this is for your example

=subfield('10-P1-12,12-P2-302,100-P3-21','-',2)&','&SubField('10-P1-12,12-P2-302,100-P3-21','-',4)

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

SubField('123TY-P1-00TY', '-', 2)

OR

=Mid('123TY-P1-00TY', 7,2)

Hope this helps you.

Regards,

Jagan.

its_anandrjs
Champion III
Champion III

This is as usual working with subfield check this example also let me clear the string is this way or it will in single line

10-P1-12,12-P2-302,100-P3-21

LOAD SubField(Str,'-',-2) as Formated,*;

LOAD * Inline

[

Str

10-P1-12

12-P2-302

100-P3-21

];

Regards

Anand

skr002244
Contributor III
Contributor III
Author

Thank you all.