Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 A | Col B |
12345 | 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 |
If Malware is on last line, then try this
TextBetween(Desc & '#','Malware name:','#') & '.corp' As MlwrNm
Does the computer name follow a set naming convention? For example will it always be the same length or end in .eu.corp?
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.
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()...
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
use combination of index and mid
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
Yes the computer name ends like ap.corp / eu.corp / na.corp. One of these three.
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.
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
TextBetween(Desc,'Computer name:','.corp') & '.corp' As CompNm