Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to extract phrases from text in a load

Hi there,

I am trying to extract some data from these fields in order to do some reporting on it

Below is a sample of the text in the field "ENTRY_TEXT"

For example I would like to run reports on the time a ticket is created until it goes to resolved.  Unfortunately the field for status only shows the last stats which int his case is "Closed"  So If I use the history I can get better accuracy.

I would like to extract the phrases from ENTRY_TEXT: "Created by" and  "to Resolved" and "to Closed"

This was I can use the ENTRY_DATE to do the time difference between them.  Unless I could do set analysis instead.

Part two I would like an if statement once this is figured out.  Like the date difference between "Created by" to either "to Resolved" or "To Closed".  I issue there is some people resolve tickets and some close them instead.  So check for resolved first then use closed if that doesn't exist.

I know this is a lot to ask.  Anyone out there on a Friday looking for some QlikView points? lol

Thanks!

   

JOB_TICKET_IDENTRY_DATEENTRY_TEXT
1655096/8/2017 15:16Updated-Ticket E-Mail sent to Jim
1655096/8/2017 15:16Status changed from Resolved to Closed
1655096/8/2017 15:16Added Client Note 9854
1655096/8/2017 13:16Updated-Ticket E-Mail sent to Jane
1655096/8/2017 13:16Status changed from In Progress to Resolved
1655096/8/2017 13:16Added new tech note.
1655096/6/2017 8:44Updated-Ticket E-Mail sent to Jane
1655096/6/2017 8:44Added new tech note.
1655096/6/2017 8:42Status changed from Open to In Progress
1655096/6/2017 8:42Set 1st-Response Date to 2017-06-06 8:42
1655096/5/2017 17:21Alert E-Mail sent to Doug
1655096/5/2017 15:45Reassigned-Ticket E-Mail sent to Doug
1655096/5/2017 15:45Assigned to Doug from Bill
1655096/5/2017 15:18New-Ticket E-Mail sent to Doug and Bill
1655096/5/2017 15:18Assigned to Bill
1655096/5/2017 15:18Created by Jane
1655096/5/2017 15:18Attached Publisher.xlsx
Header 1
1 Solution

Accepted Solutions
sunny_talwar

Try this then

If(Len(Trim(Max({<ENTRY_TEXT = {'*to Resolved*'}>}ENTRY_DATE))) = 0, Max({<ENTRY_TEXT = {'*to Closed*'}>}ENTRY_DATE), Max({<ENTRY_TEXT = {'*to Resolved*'}>}ENTRY_DATE)) - Max({<ENTRY_TEXT = {'*Created by*'}>}ENTRY_DATE)

Len(Trim()) checks for blanks/nulls

View solution in original post

13 Replies
sunny_talwar

You can use set analysis.... Something like this

{<ENTRY_TYPE = {'*Created by*'}>}

sunny_talwar

For second part... may be this

Max({<ENTRY_TYPE = {'*to Resolved*'}>}ENTRY_DATE) - Max({<ENTRY_TYPE = {'*Created by*'}>}ENTRY_DATE)

sunny_talwar

Sample image and qvw attached

Capture.PNG

Anonymous
Not applicable
Author

Hey Sunny,

Thanks for the advice.  I was missing the * for selecting the text. 

Here is the type of expression I need.  I realize this wouldn't work but it leads you in the right direction:

ENTRY_DATE {<ENTRY_TEXT={'*to Resolved*', '*to Closed*'}>}  - ENTRY_DATE {<ENTRY_TEXT={'*Created by*'}>}


Can you make this work?

Thanks so much again

Anonymous
Not applicable
Author

Whoa you read my mind!

Can you add "to Closed" in there if "to Resolved" doesn't exist?

Max({<ENTRY_TEXT = {'*to Resolved*'}>}ENTRY_DATE) - Max({<ENTRY_TEXT = {'*Created by*'}>}ENTRY_DATE)

sunny_talwar

May be this

If(Max({<ENTRY_TEXT = {'*to Resolved*'}>}ENTRY_DATE) = 0, Max({<ENTRY_TEXT = {'*to Closed*'}>}ENTRY_DATE), Max({<ENTRY_TEXT = {'*to Resolved*'}>}ENTRY_DATE)) - Max({<ENTRY_TEXT = {'*Created by*'}>}ENTRY_DATE)

Anonymous
Not applicable
Author

That doesn't work.  I believe it's because of the {'*to Resolved*'}>}ENTRY_DATE) = 0

There isn't a 0 if there is no "to Resolved".  It is just blank or null.  What is the definition for that?

sunny_talwar

Try this then

If(Len(Trim(Max({<ENTRY_TEXT = {'*to Resolved*'}>}ENTRY_DATE))) = 0, Max({<ENTRY_TEXT = {'*to Closed*'}>}ENTRY_DATE), Max({<ENTRY_TEXT = {'*to Resolved*'}>}ENTRY_DATE)) - Max({<ENTRY_TEXT = {'*Created by*'}>}ENTRY_DATE)

Len(Trim()) checks for blanks/nulls

Anonymous
Not applicable
Author

That did it.

Amazing job friend.

Thanks for making my Friday that much better.