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: 
Not applicable

String function

Hi,

I have string like this ALERT:GE-EU-DK-VALS001 -Telia Traffic -IN

I wan to get the GE-EU-DK-VALS001

19 Replies
Not applicable
Author

Hi,

I cannot use this. sometimes there may be GE-EU-DK-VAL0001

Ralf-Narfeldt
Employee
Employee

That's why you need to provide some more data so it's clear what the pattern is for splitting the field.

Otherwise we need to guess.

sasiparupudi1
Master III
Master III

if(index(string,':')>0, left(SubField(string,':',2),16),string)

Not applicable
Author

In string ALERT:GE-EU-DK-VAL001 -Telia Traffice. only highlighted is variable and sometimes there could or could not be the space before -telia. Rest format is same

Colin-Albert
Partner - Champion
Partner - Champion

You need to provide a list of say 10-20 different examples. Without this, you are being given suggestions that only work for one pattern and will fail where the data structure differs.

qlikviewwizard
Master II
Master II

qlikviewwizard
Master II
Master II

Hi qvlearn123

It is always better to provide sample data more to replicate all your requirement.

Please attach the sample application to demonstrate your requirement. Thank you.

Ralf-Narfeldt
Employee
Employee

Trim(TextBetween(Your_field, ':', '-Telia'))

MarcoWedel

TextBetween(YourFieldName,'ALERT:','-Telia')

hope this helps

Regards

Marco

maximiliano_vel
Partner - Creator III
Partner - Creator III

Try

=TextBetween(PurgeChar('ALERT:GE-EU-DK-VALS001 -Telia Traffic -IN', ' '), ':', '-Telia')

OR

=TextBetween(PurgeChar('ALERT:GE:PE:EU:DV001-Telia Traffic -I', ' '), 'ALERT:', '-Telia')