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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need to find the particular value from a sentance

I am in the process of creating a report with the list of ticket # and the computer name.

My data will be like ... Col A is the ticket # and Col B is the email alert which will be captured in the description field of ticket.

Now I would like to create a table chart/box which has to show the ticket # in first column (which is possible and I know), Then in second column I need the Computer name which is ABCD1238.eu.corp (I dont know how to do it). Is this possible?

Col ACol B
12345From: ch.alerts@abcd.com
Sent: Thursday, March 05, 2015 6:01 PM
To: Security.IncidentResponseTeam
Subject: Forefront Endpoint Protection Alert: Malware Detection

Forefront Endpoint Protection has detected malware on a computer in your organization.
Detection time (UTC): 3/5/2015 11:54:32 AM
Computer name: ABCD1238.eu.corp
Malware name: BrowserModifier:Win32/KipodToolsCby
1 Solution

Accepted Solutions
anbu1984
Master III
Master III

If Malware is on last line, then try this

TextBetween(Desc & '#','Malware name:','#') & '.corp' As MlwrNm

View solution in original post

17 Replies
chrislofthouse
Partner Ambassador
Partner Ambassador

Does the computer name follow a set naming convention? For example will it always be the same length or end in .eu.corp?

datanibbler
Champion
Champion

Hi Vijay,

sure you can. Just parse that sentence and search for "Computer name:" using one of the many String_functions QlikView has. Possibilities would be >> FindOneOf() << or >> Subfield() << -  but since the internal help_file unfortunately still lists all String_functions on one page, no matter which one you search for, you will be able to review them all and find one that suits you.

HTH

P.S.: You will probably have to combine several STRING_functions - you could first split out everything starting with the computer_name that you look for and then discard everything following it. Both could possibly be done with the Subfield() function as you can pass a nr. of words (like > Computer name: <) as separator.

jolivares
Specialist
Specialist

Just in case that you have a different line for each line of column B, try to filter in the script at load time

Load ...

From ..

where index(Col B,'Computer Name')>0

In case this is a full text try to see functions like findoneof()...

Colin-Albert
Partner - Champion
Partner - Champion

It would be better to extract the Computer Name in your load script rather then in the chart dimension.

Look at using subfield to extract the various data items from ColB

Try something like      subfield(data, ':')  or subfield(data, 'name:') 

or look at the textbetween and index() functions


Anonymous
Not applicable
Author

use combination of index and mid

index(s1 , s2[ , n])

Position of a substring. This function gives the starting position of the n:th occurrence of substring s2 in string s1. If n is omitted, the first occurrence is assumed. If n is negative, the search is made starting from the end of string s1. The result is an integer. The positions in the string are numbered from 1 and up.

Examples:

index( 'abcdefg', 'cd' ) returns 3

index( 'abcdabcd', 'b', 2 ) returns 6

index( 'abcdabcd', 'b', -2 ) returns 2

left( Date, index( Date,'-') -1 ) where Date = 1997-07-14 returns 1997

mid( Date, index( Date, '-', 2 ) -2, 2 ) where Date = 1997-07-14 returns

Anonymous
Not applicable
Author

Yes the computer name ends like ap.corp / eu.corp / na.corp.  One of these three.

Anonymous
Not applicable
Author

Hi Colin,

How should I use the script.."textbetween" because I have Malware name: after the computer name. Can somebody please help me with the script.

Anonymous
Not applicable
Author

The idea is I will have the below as a paragraph in the column "Description". Can somebody help me to do a script which will result me the computer name alone.

From: ch.alerts@abcd.com

Sent: Thursday, March 05, 2015 6:01 PM

To: Security.IncidentResponseTeam

Subject: Forefront Endpoint Protection Alert: Malware Detection


Forefront Endpoint Protection has detected malware on a computer in your organization.

Detection time (UTC): 3/5/2015 11:54:32 AM

Computer name: ABCD1238.eu.corp

Malware name: BrowserModifier:Win32/KipodToolsCby

anbu1984
Master III
Master III

TextBetween(Desc,'Computer name:','.corp') & '.corp' As CompNm