Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Partner
Partner

Extract a part from String

I have few strings like

"sulko uspedo (00:20)+podendo (01:05)+Uskudento (05:01)"

"podendo (07:25)+sulko uspedo  droggen(05:50)+Uskudento (05:01)"

"podendo (04:85)+Uskudento (03:21)+sulko uspedo (02:15)"

 

I need to extract time after key word sulko*

Result of above 3 sample should be 00:20, 05:50, 02:15 respectively; any idea on extracting time after a specific keyword would be highly appreciated. Thank you!

 

Tags (3)
Labels (3)
2 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Extract a part from String

Perhaps like this:

Example:
LOAD
    ExampleStrings,
    KeywordTimePart,
    SubField(KeywordTimePart, '(', 1) as Keyword,
    Time#(PurgeChar(SubField(KeywordTimePart, '(', 2),')'),'hh:mm') as Time
    ;
LOAD
    ExampleStrings,
        SubField(ExampleStrings, '+') as KeywordTimePart
    ;
LOAD * INLINE [
ExampleStrings
sulko uspedo (00:20)+podendo (01:05)+Uskudento (05:01)
podendo (07:25)+sulko uspedo droggen(05:50)+Uskudento (05:01)
podendo (04:85)+Uskudento (03:21)+sulko uspedo (02:15)
];

talk is cheap, supply exceeds demand
Highlighted
Valued Contributor III

Re: Extract a part from String

I would use TextBetween function like below:

LOAD *
	,TextBetween(Right(text, Len(text) - Index(text, 'sulko')), '(', ')') as Time
INLINE [
text
sulko uspedo (00:20)+podendo (01:05)+Uskudento (05:01)
podendo (07:25)+sulko uspedo droggen(05:50)+Uskudento (05:01)
podendo (04:85)+Uskudento (03:21)+sulko uspedo (02:15)
];

There is the results:

Screenshot_1.jpg